[jamming] Jam won't link my c++ app

Chris Stankevitz cstankevitz at toyon.com
Mon Jan 29 12:17:18 PST 2007


Hi,

Jam is trying to link using "cc" to link my c++ .o files which 
apparently does not include c++ routines.  Why isn't jam using an 
appropriate linker on my system?

Thank you!

Chris


chris at quinn ~/temp $ cat Jamfile
MAIN prog : test.cpp ;

chris at quinn ~/temp $ cat test.cpp
#include <iostream>

int main() {
   std::cout << "Hi";
   return 0;
}

chris at quinn ~/temp $ jam
...found 11 target(s)...
...updating 2 target(s)...
C++ test.o
Link prog
test.o: In function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x1b): undefined reference to `std::ios_base::Init::Init()'
test.o: In function `__tcf_0':
test.cpp:(.text+0x64): undefined reference to `std::ios_base::Init::~Init()'
test.o: In function `main':
test.cpp:(.text+0x86): undefined reference to `std::cout'
test.cpp:(.text+0x8b): undefined reference to `std::basic_ostream<char, 
std::cha
r_traits<char> >& std::operator<< <std::char_traits<char> 
 >(std::basic_ostream<c
har, std::char_traits<char> >&, char const*)'
test.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

cc  -o prog  test.o

...failed Link prog ...
...failed updating 1 target(s)...
...updated 1 target(s)...

chris at quinn ~/temp $ jam -v
Jam 2.5rc3. OS=LINUX. Copyright 1993-2002 Christopher Seiwald.

chris at quinn ~/temp $ uname -a
Linux quinn 2.6.18-gentoo-r5 #1 SMP PREEMPT Sat Dec 23 12:24:50 PST 2006 
i686 In
tel(R) Xeon(TM) CPU 2.40GHz GenuineIntel GNU/Linux

chris at quinn ~/temp $ ls -al
total 16
drwxr-xr-x  2 chris users 4096 Jan 29 12:38 .
drwxr-xr-x 70 chris users 4096 Jan 29 12:38 ..
-rw-r--r--  1 chris users   23 Jan 29 12:38 Jamfile
-rw-r--r--  1 chris users   69 Jan 29 12:35 test.cpp


More information about the jamming mailing list