[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Undefined reference error while linking using g++
From: |
Amit Bhatia |
Subject: |
Undefined reference error while linking using g++ |
Date: |
Sun, 27 Jun 2004 00:43:11 -0500 |
User-agent: |
KNode/0.7.2 |
Hi there.
I have written a set of classes which I compile and make into a library
libA.a
Now I am using two more libraries: B,C
So while compiling a test_example.C for the library "A",
I use the following order while linking
g++ -pg -O -Wno-deprecated -ansi -pedantic -o test test.C -DANSI_HEADERS
-D_G_HAVE_BOOL -I. -I/dir1 -I/dir2 -lA -lB -lC -L. -L/dir1 -L/dir2
But as soon as I do this, I get a lot of undefined references in one of the
class files which specifically uses library B, complaining about the
function calls that I make in this class to functions of library B.
Btw, b is written in c and not c++.
./libA.a(co_rr_exp.o)(.text+0xed): In function `A::Co_RR_Exp::Dispose()':
: undefined reference to `qh_restore_qhull(qhT**)'
and many other similar ones.
Any idea why this might be happening?
tia,
amit.
- Undefined reference error while linking using g++,
Amit Bhatia <=