Original Post
🔒 Locked
Creating Library files?
Advertisement
Well,
It depends if you want to make shared libraries or static libraries.
The general procedure to do, say for C and assuming GNU tools, for a shared library is:
user@machine:~ $ gcc -c -fpic module1.c module2.c module3.c
user@machine:~ $ ld -Bshareable -o mylib.so.1.0 module1.o module2.o module3.o
Then obviously you''ll have to link against this library to use it when you compile programs that use those library calls.
FYI HTH,
.zfod
It depends if you want to make shared libraries or static libraries.
The general procedure to do, say for C and assuming GNU tools, for a shared library is:
user@machine:~ $ gcc -c -fpic module1.c module2.c module3.c
user@machine:~ $ ld -Bshareable -o mylib.so.1.0 module1.o module2.o module3.o
Then obviously you''ll have to link against this library to use it when you compile programs that use those library calls.
FYI HTH,
.zfod
quote:
Original post by zfod
user@machine:~ $ ar rc mylib.a module1.o module2.o module3.o
user@machine:~ $ ranlib mylib.a
Tried that. It dosn''t want to work right. I have to have a global instance of each class object in the library or the I get undefined referance errors on all the class function calls in my project.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement