Skip to contentSkip to conversation

Cross compilation question

DISCUSSION Toni Van Remortel 3 participants 4 messages Sep 9, 2003 – Sep 10, 2003

lore
Share & tools
lore
#0 lore raw

Hi all,

I've installed ELDK as compiler-set, and it is successfully used to compile linuxppc_2_4_devel, rtai and FLTK for my EP405 board.

Now I have a FLTK-based program which I like to cross-compile, but I get stuck to one error I cannot solve right now:

ppc_4xx-g++ -static -g test.cxx -I/ppc/fltk-1.1.4rc2 -o test -L/opt/eldk/ppc_4xx/lib -L/opt/eldk/ppc_4xx/usr/lib -L/ppc/fltk-1.1.4rc2/lib -L/opt/PPC_X/usr/X11R6/lib -L/opt/PPC_X/usr/lib -lfltk -lXext -lX11
/opt/eldk/usr/ppc-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

As far as I know, is libstdc++.so in /opt/eldk/ppc_4xx/usr/lib, which is added as -L.

Anyone who know the solution (which will probably be easy).

Regards.
--
Toni Van Remortel
Wetenschappelijk Medewerker - D-science lab
Tel: +32 3 205 61 72 - Fax: +32 3 205 61 95
E-mail: [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 16 lines · In message <1063093493.12979.4.camel@toni> you wrote:

Hi all,

I've installed ELDK as compiler-set, and it is successfully used to compile linuxppc_2_4_devel, rtai and FLTK for my EP405 board.

Now I have a FLTK-based program which I like to cross-compile, but I get stuck to one error I cannot solve right now:

ppc_4xx-g++ -static -g test.cxx -I/ppc/fltk-1.1.4rc2 -o test

(quoted diff) +0 -3
-L/opt/eldk/ppc_4xx/lib -L/opt/eldk/ppc_4xx/usr/lib
-L/ppc/fltk-1.1.4rc2/lib -L/opt/PPC_X/usr/X11R6/lib -L/opt/PPC_X/usr/lib
-lfltk -lXext -lX11

/opt/eldk/usr/ppc-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Quoted 4 lines

As far as I know, is libstdc++.so in /opt/eldk/ppc_4xx/usr/lib, which is added as -L.

Anyone who know the solution (which will probably be easy).

First, your list of "-L" options makes little sense to me. There is no need to add /opt/eldk/ppc_4xx/lib or -L/opt/eldk/ppc_4xx/usr/lib.

Second: did you try what happens when you omit the "-static" argument?

If you really must link with "-static", try something like this:

GCCLIBDIR=/opt/eldk/ppc_4xx/usr/lib/gcc-lib/ppc-linux/2.95.4 ${CROSS_COMPILE}g++ -static -L${GCCLIBDIR} ...

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] No journaling file system can recover your data if the disk dies.
- Steve Rago in <[email protected]>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to Toni Van Remortel
Quoted 15 lines · Toni Van Remortel

Hi all,

I've installed ELDK as compiler-set, and it is successfully used to compile linuxppc_2_4_devel, rtai and FLTK for my EP405 board.

Now I have a FLTK-based program which I like to cross-compile, but I get stuck to one error I cannot solve right now:

ppc_4xx-g++ -static -g test.cxx -I/ppc/fltk-1.1.4rc2 -o test

(quoted diff) +0 -3
-L/opt/eldk/ppc_4xx/lib -L/opt/eldk/ppc_4xx/usr/lib
-L/ppc/fltk-1.1.4rc2/lib -L/opt/PPC_X/usr/X11R6/lib -L/opt/PPC_X/usr/lib
-lfltk -lXext -lX11

/opt/eldk/usr/ppc-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Quoted 2 lines

As far as I know, is libstdc++.so in /opt/eldk/ppc_4xx/usr/lib, which is added as -L.

Do you have a libstdc++.a? You'd need that to satisfy the -static.
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Wolfgang Denk

Op di 09-09-2003, om 18:18 schreef Wolfgang Denk:

Quoted 23 lines
Quoted 14 lines · In message <1063093493.12979.4.camel@toni> you wrote:

I've installed ELDK as compiler-set, and it is successfully used to compile linuxppc_2_4_devel, rtai and FLTK for my EP405 board.

Now I have a FLTK-based program which I like to cross-compile, but I get stuck to one error I cannot solve right now:

ppc_4xx-g++ -static -g test.cxx -I/ppc/fltk-1.1.4rc2 -o test

(quoted diff) +0 -3
-L/opt/eldk/ppc_4xx/lib -L/opt/eldk/ppc_4xx/usr/lib
-L/ppc/fltk-1.1.4rc2/lib -L/opt/PPC_X/usr/X11R6/lib -L/opt/PPC_X/usr/lib
-lfltk -lXext -lX11

/opt/eldk/usr/ppc-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Quoted 4 lines

As far as I know, is libstdc++.so in /opt/eldk/ppc_4xx/usr/lib, which is added as -L.

Anyone who know the solution (which will probably be easy).

First, your list of "-L" options makes little sense to me. There is no need to add /opt/eldk/ppc_4xx/lib or -L/opt/eldk/ppc_4xx/usr/lib.

Quoted 6 lines

Second: did you try what happens when you omit the "-static" argument?

If you really must link with "-static", try something like this:

GCCLIBDIR=/opt/eldk/ppc_4xx/usr/lib/gcc-lib/ppc-linux/2.95.4 ${CROSS_COMPILE}g++ -static -L${GCCLIBDIR} ...

I removed the eldk-lib stuff, and added the GCCLIBDIR. Now, it compiles, but doesn't link. A lot of 'undefined reference to' which I don't understand (they all are about FLTK though).

Thank you for your help already.

PS: I need the -static, but without it, it gives me some more undefined references to the X-libs.
--
Toni Van Remortel
Wetenschappelijk Medewerker - D-science lab
Tel: +32 3 205 61 72 - Fax: +32 3 205 61 95
E-mail: [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/