On OSX are different types of libraries.
If I look inside /usr/lib/ there are some withe extension .o, some with .a, .so and some .dylib.
Is it normal that I can only use .dylib with OpenLibrary() ?
OpenLibrary() dose not work
OpenLibrary() dose not work
macOS Catalina 10.15.7
Re: OpenLibrary() dose not work
.dylib = dynamic library
.dll = dynamic link library
.a, .o, .so, .obj, .lib are objects/libraries for use with the linker, not dynamically at runtime.
.dll = dynamic link library
.a, .o, .so, .obj, .lib are objects/libraries for use with the linker, not dynamically at runtime.
Re: OpenLibrary() dose not work
Probably using Import/ImportC.
Re: OpenLibrary() dose not work
if that don't work you could try and make a dylib, copy the a.o file to some temp folder and then launch the terminal, cd to to the temp folder and issue the following command
gcc -shared -o a.dylib a.o
the reason for using gcc instead of ar is that gcc will try to find dependencies if any.
gcc -shared -o a.dylib a.o
the reason for using gcc instead of ar is that gcc will try to find dependencies if any.
Re: OpenLibrary() dose not work
I get an error:tejon wrote:if that don't work you could try and make a dylib, copy the a.o file to some temp folder and then launch the terminal, cd to to the temp folder and issue the following command
gcc -shared -o a.dylib a.o
the reason for using gcc instead of ar is that gcc will try to find dependencies if any.
file was built for i386 which is not the architecture being linked (x86_64).
Can you tell me how to fix that?
macOS Catalina 10.15.7
Re: OpenLibrary() dose not work
if a.o is a 32-bit object then try the following
gcc -m32 -shared -o a.dylib a.o
gcc -m32 -shared -o a.dylib a.o
Re: OpenLibrary() dose not work
Sounds like you are trying to use a x86 lib with PB x64. Use PB x86 with x86 libs,Wolfram wrote:I get an error:
file was built for i386 which is not the architecture being linked (x86_64).
and PB x64 with 64-bit libs.
Re: OpenLibrary() dose not work
As far as I understand both .dylib and .so can be loaded at runtime.Danilo wrote:.a, .o, .so, .obj, .lib are objects/libraries for use with the linker, not dynamically at runtime.
If you need a little more control compared to OpenLibrary, you can use dlopen, dlsym, dlclose and dlerror .
.a and .o can indeed be used with ImportC.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)