Zaurus-X-gcc won't compile (C++)

Everything about embedded cross-compilers

Zaurus-X-gcc won't compile (C++)

Postby hns on Thu May 13, 2004 5:38 pm

Copied from a user's E-Mail:
-------------------------------------
Hi;

I'm attempting to set up Zaurus X-gcc on my Powerbook G4 running 10.3.3 and the latest version of Apple's X11 SDK and XCode tools. The pkg file installs without complaint, but attempting to compile the following program:

Code: Select all
#include <iostream.h>

main()
{
    cout << "Hello World!";
    return 0;
}


gives this error:
Code: Select all
/var/tmp/ccrbA9wX.o: In function `main':
/var/tmp/ccrbA9wX.o(.text+0x14): undefined reference to `ostream::operator<<(char const *)'
/var/tmp/ccrbA9wX.o(.text+0x28): undefined reference to `cout'
collect2: ld returned 1 exit status


Do you know what could be causing this error? I'd really like to get started developing for the SL-6000, but my inability to cross-compile is holding me back. Thanks.
Last edited by hns on Thu May 13, 2004 5:41 pm, edited 1 time in total.
hns
Site Admin
 
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Postby hns on Thu May 13, 2004 5:39 pm

It appears you are compiling C++ and the linker is missing some symbols.
This might need to add the proper -I and -L paths for the header files. Try something like:

Code: Select all
gcc -I/Developer/Zaurus-X-gcc/opt/Embedix/tools/include/g++-3 -L/Developer/Zaurus-X-gcc/opt/Embedix/tools/lib/g++-3 main.cpp


You might also have to add -lstdc++
hns
Site Admin
 
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm

Postby hns on Thu May 13, 2004 5:40 pm

You might also have to add -lstdc++


That did it! Thanks!
hns
Site Admin
 
Posts: 328
Joined: Tue Apr 27, 2004 8:06 pm


Return to Developer / Xtoolchain / Zaurus-X-gcc / QuantumCode

Who is online

Users browsing this forum: No registered users and 1 guest

cron