delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/25/19:44:31

Date: Thu, 26 May 1994 00:10:22 +0100
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: mag1007 AT hermes DOT cam DOT ac DOT uk (Martin Granell)
Subject: Creating Libraries

        Hi,
                I've got a load of c files. I wanted to create a library 
with all their functions in. The way I did it was to compile them, creating 
.o files. Then I use ar clq libtcp.a $(OB_FILES), with OB_FILES set to the 
.o file names. I then did ranlib libname. This produced a file called libtcp.a
        I thought that I could simply link my programs with this library 
using the -l<LibName> argument for GCC. (Using appropriate headers, etc.)
        Unfortunately it says undefined reference to 'functionname'. With a 
line number and file at the front. ie it couldn't find the functions in the 
library.
        Does any one know what I am doing wrong? I'm sorry if it's in the 
FAQ, cut I've checked through it and ca't find it.

        Any help would be appreciated.

                        Yours,

                                Martin.

p.s. Dj, this library is a TCP/IP library, and, thanks to Michal Furmanczyk 
will hopefully give full UNIX like socket capability to DJGPP.....


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019