This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem linking lib c with gcc
- To: gcc-help at gcc dot gnu dot org
- Subject: problem linking lib c with gcc
- From: Sergio Queiroz <sergio at consiste dot dimap dot ufrn dot br>
- Date: Thu, 15 Mar 2001 13:07:16 -0300 (EST)
Hi,
I am involved in a project where I should add a graphical interface for
a library written in C, and I intend to use Qt, written in C++, to develop
the graphical interface. I have some problems with linkage, using either
g++ or gcc.
I reproduced the problem on a trivial example that links both the Qt
library (C++) and a toy stack library (C).
The log is:
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 *)'
collect2: ld returned 1 exit status
My gcc version is 2.95.2