Linker problems: dependencies with .a file not resolved?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using CMake to build a library (as a .a file) and a demo program
for that library.

My problem is that when I go to link that demo program, I get a linker
error that says one file function in the .a file can't find another
function in the .a file.  Here's what the linker command line and
error output look like:

Linking CXX executable simpleIO
cd /home/cjc/csc583-svn/uriVisionLib/trunk/SDK/Demos/C++/Basic/Simple_IO
&& /home/cjc/packages/CMake/bin/cmake -P
CMakeFiles/simpleIO.dir/cmake_clean_target.cmake
cd /home/cjc/csc583-svn/uriVisionLib/trunk/SDK/Demos/C++/Basic/Simple_IO
&& /usr/bin/c++      -fPIC "CMakeFiles/simpleIO.dir/main_IO.o"   -o
simpleIO -rdynamic
-L/home/cjc/csc583-svn/uriVisionLib/trunk/Development/Source/C++ -lGL
-lglut -Wl,-Bstatic -luriVision -luriVision -Wl,-Bdynamic
-Wl,-rpath,/home/cjc/csc583-svn/uriVisionLib/trunk/Development/Source/C++
/home/cjc/csc583-svn/uriVisionLib/trunk/Development/Source/C++/liburiVision.a(ImageReader.o):
In function `uriVideoSources::ImageReader::getFrame(bool,
uriBase::RasterImage*)':
ImageReader.cpp:(.text+0x90): undefined reference to
`uriVideoSources::ImageReader_gen::getFrame_(bool,
uriBase::RasterImage*)'

(there are more errors as well, but I figured this was enough to make my point).

I thought that perhaps the supposedly missing function wasn't in the
.a file, so I check with nm as follows:

cjc@peace:~$ nm --demangle
/home/cjc/csc583-svn/uriVisionLib/trunk/Development/Source/C++/liburiVision.a
| grep outputFrame
0000002c T uriMovieEditing::ImageWriter::outputFrame(uriBase::RasterImage*)
00000000 T uriMovieEditing::ImageWriter::outputFrame(uriBase::RasterImage*,
bool)
        U uriMovieEditing::ImageWriter_gen::outputFrame_(uriBase::RasterImage*,
bool)


So it appears to be in there.  I also thought that maybe this was one
of the cases where I needed to list the .a file twice on the linker
command line, but the linker invocation / output shown above already
reflects my doing that (I think).

Does anyone know where I might be going wrong here?

Thanks,
Christian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux