Forum > Unix

Loading .so Files in Program

<< < (5/6) > >>

marcov:
Another thing to try is passing an absolute path.

But I avoided pascal generated shared libs, and installed other libs in their directories and registered any new library directories with "ldconfig".

garlar27:

--- Quote from: marcov on August 14, 2015, 03:53:28 pm ---Another thing to try is passing an absolute path.

But I avoided pascal generated shared libs, and installed other libs in their directories and registered any new library directories with "ldconfig".

--- End quote ---
And that's the right way!!

PatrickS:
I tried all of this but the problem still exists....

Probably an error of the compiler. Please can anybody verify this problem before a bug report will be generated.

Architecure is armhf compiler 2.6.4  (debian wheezy) ( Pakages is in backports)
also with the compiler 3.1.1 this error occurs.

Best regards
Patrick

garlar27:
Now I'm on Linux trying your code but I cant compile the library because a weird error (Error: Illegal parameter: -WR). It's not in your code but in the project config, I think. I never had this error compiling and I can't find that parameter....

garlar27:

--- Quote from: garlar27 on August 20, 2015, 02:31:19 pm ---Now I'm on Linux trying your code but I cant compile the library because a weird error (Error: Illegal parameter: -WR). It's not in your code but in the project config, I think. I never had this error compiling and I can't find that parameter....


--- End quote ---

My bad, I found it.

The attached example runs on my Ubuntu 10.04, compiled using FPC 2.6.2 and an old Lazarus.

No need to register anything to OS just compile the library, the tester project and run it!!

Is weird that I had to do this

--- Code: ---const
   PROJECT1_DLL_LIBRARY_NAME = {$IFDEF UNIX}'lib'+{$ENDIF}'project1_dll.' + SharedSuffix;
   PROJECT1_DLL_LIBRARY_PROC_PATRICK_ADD = 'Patrick_Add';

--- End code ---
although I was telling you it wasn't necessary (to add the prefix and the suffix). My projects do not have it!!! %) %) %) %)

If you keep having problems, then I think you should report it to the bug tracker.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version