This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link error building eCos CVS host tools on FC2


On Sat, Nov 20, 2004 at 12:58:32AM -0800, Craig Barratt wrote:
> I fetched the latest snapshot from
> 
>     http://www.ecoscentric.com/devzone/snapshots.shtml
> 
> and compiled with:
> 
>     mkdir ecos-cvs-build
>     cd ecos-cvs-build/
>     /opt/ecos/ecos-cvs/ecos/configure --prefix=/usr
>     make
> 
> but it fails when linking ecosconfig:
> 
>     c++ -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual -O0   -o ecosconfig  ecosconfig.o cdl_exec.o build.o flags.o  -lcdl -lcyginfra -L/usr/lib -ltcl8.4  -L/opt/ecos/ecos-cvs-build/host/libcdl -L/opt/ecos/ecos-cvs-build/host/infra
>     cdl_exec.o(.text+0x80): In function `cdl_exec::cdl_exec[not-in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
>     : undefined reference to `CdlTransactionBody::set_inference_callback_fn(CdlInferenceCallbackResult (*)(CdlTransactionBody*))'
>     cdl_exec.o(.text+0x88): In function `cdl_exec::cdl_exec[not-in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
>     : undefined reference to `CdlTransactionBody::disable_automatic_inference()'
>     [100's of undefined symbol errors omitted]
> 
> Looking on Google I could only come up with this mail, which didn't
> have a useful follow up:
> 
>     http://sources.redhat.com/ml/ecos-discuss/2004-04/msg00072.html
> 
> I'm using gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7).

This sounds like a compiler/linker bug. It compiles fine on my Debian
unstable system with gcc version 3.3.5.

The post says he had to tell gcc where libstdc++. For my toolchain
this happens automatically:

lunn@londo:~/eCos/build/host/tools/configtool/standalone/common$ c++ -v -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual -O0   -o ecosconfig  ecosconfig.o cdl_exec.o build.o flags.o  -lcdl -lcyginfra -L/usr/lib -ltcl8.3  -L/home/lunn/eCos/build/host/libcdl -L/home/lunn/eCos/build/host/infra
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-2)
 /usr/lib/gcc-lib/i486-linux/3.3.5/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o ecosconfig /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.5/crtbegin.o -L/usr/lib -L/home/lunn/eCos/build/host/libcdl -L/home/lunn/eCos/build/host/infra -L/usr/lib/gcc-lib/i486-linux/3.3.5 -L/usr/lib/gcc-lib/i486-linux/3.3.5/../../.. ecosconfig.o cdl_exec.o build.o flags.o -lcdl -lcyginfra -ltcl8.3 -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i486-linux/3.3.5/crtend.o /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crtn.o

Here you can see it has -lstdc++ and the
-L/usr/lib/gcc-lib/i486-linux/3.3.5 points to where it lives. 

Try linking -v on your system. See if you need to add extra paths and
libraries to get this to work.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]