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

RE: Axis linking problems (again)



I compiled and built comio.o using the separate makefile for the test app,
and then 
tried linking just comio.o to my app with another makefile. I guess the
"-xc++" option
caused some of the problems here, because it is the main difference between
the two
makefiles. Linking comio.o to my app almost works, there is only one error:

gcc_cris -melinux -s -symbolic -nostdlib -L/projects/xxx/axis/eroot/lib
/proj
ects/xxx/axis/eroot/lib/uccrt0.o main.o file2.o file3.o file4.o file5.o 
file6.o file7.o file8.o file9.o file10.o file11.o file12.o file13.o 
file14.o file15.o file16.o file17.o file18.o file19.o file20.o comio.o -lgcc
-lucc -lic  -o main
/projects/xxx/axis/eroot/lib/libucc.a(itoa.o)(.text+0x24): undefined
reference
 to `___Mod'
make: *** [main] Error 1

Any suggestions?

BR,
Timo

> -----Original Message-----
> From: Timo.Sakari@xxxxxxx.fi">mailto:Timo.Sakari@xxxxxxx.fi]
> Sent: 19. helmikuuta 2001 17:15
> To: johan.adolfsson@xxxxxxx.com
> Subject: RE: Axis linking problems (again)
> 
> 
> Johan,
> 
> > If comio.c really is a C file an not C++, 
> > try modifying the Makefile so you don't have -the -xc++ as an option
> > when compiling it.
> 
> I _have_ to use "-xc++" because in my sources there are some 
> C++ specific
> stuff in some .h files, which are included to .c files, which 
> causes the
> compilation to fail.
> 
> Propably one work around would be to create a seperate 
> makefile to build
> comio.o, and
> then link that to my main project?
> 
> Timo
> 
> > 
> > /Johan
> > 
> > ----- Original Message ----- 
> > From: <Timo.Sakari@xxxxxxx.fi>
> > To: <johana@xxxxxxx.com>
> > Sent: Monday, February 19, 2001 15:29
> > Subject: RE: Axis linking problems (again)
> > 
> > 
> > > Johan,
> > > 
> > > Your suggestion doesn't help:
> > > 
> > > comio.o(.text+0x92): undefined reference to 
> > `_tcgetattr__FiP7termios'
> > > comio.o(.text+0x24e): undefined reference to `_tcflush__Fii'
> > > comio.o(.text+0x25c): undefined reference to 
> > `_tcsetattr__FiiP7termios'
> > > comio.o(.text+0x332): undefined reference to 
> > `_tcsetattr__FiiP7termios'
> > > comio.o(.text+0x494): undefined reference to `_tcdrain__Fi'
> > > comio.o(.text+0x4c8): undefined reference to `_tcdrain__Fi'
> > > comio.o(.text+0x504): undefined reference to `_tcdrain__Fi'
> > > comio.o(.text+0x62a): undefined reference to `_tcflush__Fii'
> > > comio.o(.text+0x650): undefined reference to `_tcsendbreak__Fii'
> > > 
> > 
> /projects/12150/axis/eroot/lib/libucc.a(itoa.o)(.text+0x24): undefined
> > > reference
> > >  to `___Mod'
> > > make: *** [main] Error 1   
> > > 
> > > BR,
> > > Timo
> > > 
> > > > -----Original Message-----
> > > > From: Johan Adolfsson [mailto:johan.adolfsson@xxxxxxx.com]
> > > > Sent: 19. helmikuuta 2001 15:44
> > > > To: Timo.Sakari@xxxxxxx.com
> > > > Subject: Re: Axis linking problems (again)
> > > > 
> > > > 
> > > > I'm not sure but...
> > > > Since you're compiling as C++ you must have
> > > > extern "C" {
> > > > #include <termios.h>
> > > > };
> > > > 
> > > > etc. or something around the C header files.
> > > > 
> > > > I don't think the uC-libc header files do the
> > > > #ifdef __cplusplus
> > > > check themselves.
> > > > 
> > > > Hope this helps.
> > > > /Johan
> > > > 
> > > > 
> > > > ----- Original Message ----- 
> > > > From: <Timo.Sakari@xxxxxxx.fi>
> > > > To: <dev-etrax@xxxxxxx.com>
> > > > Sent: Monday, February 19, 2001 14:33
> > > > Subject: FW: Axis linking problems (again)
> > > > 
> > > > 
> > > > > I am re-sending this, because no response whatsoever 
> > was received...
> > > > > 
> > > > > Timo
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: Sakari Timo 
> > > > > > Sent: 10. helmikuuta 2001 13:59
> > > > > > To: 'dev-etrax@xxxxxxx.com'
> > > > > > Subject: Axis linking problems (again)
> > > > > > 
> > > > > > 
> > > > > > Dear Sirs,
> > > > > > 
> > > > > > I am trying to port a software component to ETRAX100/ELinux,
> > > > > > and I have some problems.
> > > > > > 
> > > > > > I have managed to compile and build the component to 
> > Axis, until
> > > > > > recently, when I tried to integrate a new file into 
> > my project.
> > > > > > This file is a simple wrapper library used for 
> making handling
> > > > > > Linux serial ports easier.
> > > > > > 
> > > > > > I could easily use this new file (comio.c) from a 
> simple test
> > > > > > application, it compiled and build easily. Attached is 
> > > > the makefile
> > > > > > for this test app (Makefile.mbox.comio).
> > > > > > 
> > > > > > However, when I try to integrate this comio.c to the 
> > existing SW
> > > > > > component, which I am trying to port to ELinux, there are 
> > > > some linking
> > > > > > problems. Makefile "Makefile.mbox.sw_component" is 
> > attached. Here
> > > > > > are the essential parts of the compiler/linker output:
> > > > > > 
> > > > > > gcc_cris -melinux -O2 -Wall -D__linux__ -DELINUX -Wall 
> > > > > > -DPROJECT_XXX -DTARGET_A
> > > > > > XIS -nostdinc -I/projects/xxx/axis/eroot/include/uC-libc 
> > > > > > -xc++    -c -o comio.
> > > > > > o comio.c
> > > > > > 
> > > > > > <CLIP>
> > > > > > 
> > > > > > gcc_cris -melinux -s -symbolic -nostdlib 
> > > > > > -L/projects/xxx/axis/eroot/lib  /proj
> > > > > > ects/xxx/axis/eroot/lib/uccrt0.o main.o file2.o file3.o 
> > > > > > file4.o file5.o 
> > > > > > file6.o file7.o file8.o file9.o file10.o file11.o 
> > > > file12.o file13.o 
> > > > > > file14.o file15.o file16.o file17.o file18.o file19.o 
> > > > > > file20.o comio.o -lgcc
> > > > > > -lucc -lic  -o main
> > > > > > comio.o(.text+0x92): undefined reference to 
> > > > `_tcgetattr__FiP7termios'
> > > > > > comio.o(.text+0x24e): undefined reference to `_tcflush__Fii'
> > > > > > comio.o(.text+0x25c): undefined reference to 
> > > > > > `_tcsetattr__FiiP7termios'
> > > > > > comio.o(.text+0x332): undefined reference to 
> > > > > > `_tcsetattr__FiiP7termios'
> > > > > > comio.o(.text+0x494): undefined reference to `_tcdrain__Fi'
> > > > > > comio.o(.text+0x4c8): undefined reference to `_tcdrain__Fi'
> > > > > > comio.o(.text+0x504): undefined reference to `_tcdrain__Fi'
> > > > > > comio.o(.text+0x62a): undefined reference to `_tcflush__Fii'
> > > > > > comio.o(.text+0x650): undefined reference to 
> > `_tcsendbreak__Fii'
> > > > > > /projects/xxx/axis/eroot/lib/libucc.a(itoa.o)(.text+0x24): 
> > > > > > undefined reference
> > > > > >  to `___Mod'
> > > > > > make: *** [main] Error 1
> > > > > > 
> > > > > > All the necessary stuff is included in comio.c:
> > > > > > 
> > > > > > #include "config.h"
> > > > > > #include <errno.h>
> > > > > > #include <fcntl.h>
> > > > > > #include <sys/file.h>
> > > > > > #include <sys/ioctl.h>
> > > > > > 
> > > > > > /* Don't include these in Axis compilation */
> > > > > > #ifdef TARGET_MSERVER
> > > > > > #include <sys/procfs.h>
> > > > > > #include <sys/select.h>
> > > > > > #endif
> > > > > > 
> > > > > > #include <string.h>
> > > > > > #include <stdio.h>
> > > > > > #include <termios.h>
> > > > > > #include <time.h>
> > > > > > #include <sys/types.h>
> > > > > > #include <unistd.h>
> > > > > > 
> > > > > > 
> > > > > > What I am doing wrong here? I guess this is another 
> > > > compiler/linker
> > > > > > options error. I tried a couple of other options 
> > also, but with no
> > > > > > success.
> > > > > > 
> > > > > > By the way, what's the deal with "sys/procfs.h" and 
> > "sys/select.h"
> > > > > > header files, they were not found? I assume the stuff is in
> > > > > > some other files in Axis environment?
> > > > > > 
> > > > > > 
> > > > > > BR,
> > > > > > 
> > > > > > --
> > > > > >   Timo Sakari, email: Timo.Sakari@xxxxxxx.fi
> > > > > > 
> > > > > >   "#define QUESTION ((bb) || !(bb))"    - Shakespeare
> > > > > > 
> > > > > 
> > > > > 
> > > > 
> > > 
> > 
>