MadDog
Member
So how does one make a lib with gcc, i've looked at the online docs and can't find the wood for the trees. Is is as simple as namng the output file as libMYLIB.a ???
Thanks.
Thanks.
I haven't tried it myself yet, but when I was looking into it, one of the links that made the most sense to me was the following: http://www.tldp.org/HOWTO/Program-Library-...-libraries.htmlMadDog posted on May 1 2006 at 08:50 PM said:So how does one make a lib with gcc, i've looked at the online docs and can't find the wood for the trees. Is is as simple as namng the output file as libMYLIB.a ???
Thanks, i'll go and check it out.scorpio posted on May 1 2006 at 09:18 PM said:I haven't tried it myself yet, but when I was looking into it, one of the links that made the most sense to me was the following: http://www.tldp.org/HOWTO/Program-Library-...-libraries.html
.net 2003scorpio posted on May 1 2006 at 09:18 PM said:What development environment are you using?
$(AR) cru $(LIBFILE) $(LIB_OBJ)
$(RANLIB) $(LIBFILE)
As long as you only have one source file, that approach is fine, but don't bother giving it a .a extension, just use .o. The -l command won't work because that specifically tells it to look for archives, which you didn't build. Those are built as a post-processing step using ar and ranlib, as a previous poster mentioned.MadDog posted on May 2 2006 at 10:20 AM said:I've created an archive that works. I called the output file "libK9.a" I called it this as I thought gcc lib files had to begin with lib and end in .a
Trying to include the lib with the -l command on the linker does not work. Specifying as just a input file works.
Should I worry about this or is an 'archive' different to a lib file, I thought that they were the same thing.
I'm a bit confused :huh:
P.s. I'm not using a make file.
