Compilation with Development Libraries

Compilation with Development Libraries

Post by JOHN B LOREN » Fri, 09 Nov 2001 06:08:26



I'm making an attempt to compile a program which includes code from a C
development library on Sun Solaris.  The library suffixes are ".so" and
".a".  I am not having any luck with a make file or using a simple command
line "cc" compilation process.

What I am compiling would be something like this:

foobar.o
libfoobar.so
libfoobar.a

Is there something I need to know or do differently to include and compile
these libraries?

Thanks,

John Lorenz

 
 
 

Compilation with Development Libraries

Post by eric » Sun, 11 Nov 2001 14:04:42



> I'm making an attempt to compile a program which includes code from a C
> development library on Sun Solaris.  The library suffixes are ".so" and
> ".a".  I am not having any luck with a make file or using a simple command
> line "cc" compilation process.

> What I am compiling would be something like this:

> foobar.o

cc -c foobar.c

Quote:> libfoobar.so

cc -fPIC -c foobar.c
ld -dy -G -o libfoobar.so foobar.o
This is what I do to make dlopenable files, should work for libraries as
well

Quote:> libfoobar.a

cc -c foobar.c
ar -car libfoobar.a foobar.o
ranlib libfoobar.a

I think there is an option to ar (like -s) to do the same thing as
ranlib

Eric

 
 
 

Compilation with Development Libraries

Post by Bjorn Rees » Mon, 12 Nov 2001 21:53:01



> Is there something I need to know or do differently to include and compile
> these libraries?

Check the -l and -L options for your C compiler.
 
 
 

1. a bit lost with libraries and general compilation

i am trying to make a  program using someone an SDK that came with its
own library.

anyway, i added another implementation file whose object file i
"thought" i put in with
ar [library].a [myfile].o

that's not the real problem.

i put my Makefile, and my "main" program in ../bin
my library in ../lib
my headers in ../include

i assume this is correct

anyway, i'm sure the makefile is correct cuz i didn't change a thing
really from the example that came with the SDK.

here's my question:
how come when i use make, or gcc or some compilation tool that it
keeps saying functions i defined in  my own implementation file are
not found?!

I put the prototypes in my .h in my ../include
i put the implementation in my .o that i added to the library.

where's the problem?

2. simple question: Can I mount ext2 file system from freeBSD 4.0 ?

3. Motif development libraries for linux, correction :)

4. SSL support for non-SSL web server

5. libbadpenguin 1.0.0 - generic library and scripts for console tools development

6. Minicom vt102 screen is trashed

7. QT compilation problem: missing library!

8. WILL stealth 64 work? Y/N?

9. imake & ELF Shared Library Compilation

10. Leffler's TIFF Library -- DOS compilation?

11. SCO Unix libraries and Linux Development

12. Compilation problem with library

13. Image Magick Development library problem