Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2000 11:10:06 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Henrik Nilsson <Henrik.Nilsson@west.se>
Cc:        questions@freebsd.org
Subject:   Re: Creating libraries with "ar" fails...
Message-ID:  <14868.5358.416403.621320@guru.mired.org>
In-Reply-To: <52823016@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Henrik Nilsson <Henrik.Nilsson@west.se> types:
> I'm trying to create an archive file (libxmlnode.a) with one object file in it
> (XmlNode.o), but when I link the archive file with my testprogram I get a lot
> of undefined references.
>
> Below you can see the error message.
> 
> The command I use to create the lib file is:
> ar rs libxmlnode.a XmlNode.o
> (with the s parameter you get the same result as running ranlib on the
> archive later)
> 
> Is there anything else I need to do in order to get it to work?
> Or have I just forgot something?
> 
> regards,
> Henrik Nilsson
> 
> ps. please reply to my emailaddress as well, as I'm not a member of this
> mailinglist. Thanks! ds.
> 
> - --error message---
> g++ -ggdb -Wall -pedantic -Wtraditional -Wshadow -Wpointer-arith  -Wcast-qual
> - -Wcast-align -Wconversion -Wstrict-prototypes  -Wmissing-declarations
> - -Wredundant-decls -Woverloaded-virtual  -Winline -ansi -pipe
> '-Dperror(x)={char buff[256]; sprintf(buff, "%s[%d]::%s() reported \"%s\"
> with reason", __FILE__, __LINE__, __FUNCTION__, x); perror(buff);}'
> libxmlnode.a main.cpp -o main

Shouldn't the last few be: main.cpp libxmlnode.a -o main

	<mike


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14868.5358.416403.621320>