This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: problem linking lib c with gcc
- To: 'Alexandre Oliva' <aoliva at redhat dot com>, Sergio Queiroz <sergio at consiste dot dimap dot ufrn dot br>
- Subject: RE: problem linking lib c with gcc
- From: David Korn <dkorn at pixelpower dot com>
- Date: Fri, 16 Mar 2001 11:30:54 -0000
- Cc: gcc-help at gcc dot gnu dot org
>-----Original Message-----
>From: Alexandre Oliva [mailto:aoliva@redhat.com]
>Sent: 15 March 2001 22:09
>On Mar 15, 2001, Sergio Queiroz <sergio@consiste.dimap.ufrn.br> wrote:
>
>> gcc -o menu main.o menu.o -L. -lstack -lmem -lqt
>> menu.o:In function `Menu::Menu(QWidget *, char const *)':
>> menu.o(.text+0x31): undefined reference to
>`stack_New(unsigned int, unsigned int)'
>> menu.o(.text+0x45): undefined reference to
>`stack_Dispose(stackCell *)'
>
>So, where is it that these functions should be defined? Perhaps they
>should have been declared with `extern "C"', or you failed to #include
>some header file?
Or is this perhaps to do with the order in which the link libs are
listed? Maybe -lstack should come after -lqt ? And perhaps the same for
-lmem?
DaveK
--
All your base are belong to us!
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************