[uClibc]compile a simple hello C++ program
Ivan Ng
wkn at hknet.com
Tue Sep 17 07:27:57 UTC 2002
Hi.
I grab the uClinux-dist source and follow instructions on:
http://www.uclinux.org/pub/uClinux/archive/8306.html to build my kernel and toolchains.
Everything seems ok so far. I then try to add an simple "hello" application written in C++, but the compile
fails. Here is my hello example:
#include <iostream.h>
int main(int argc, char* argv[]) {
cout << "hello world" << endl;
return 0;}
Here is the error message I received:
make[2]: Entering directory `/opt/uc_newbuild/uClinux-dist/user/hello'
arm-elf-g++ -Os -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/opt/uc_newbuild/uClinux-dist/lib/libc/include
-I/opt/uc_newbuild/uClinux-dist/lib/libm -I/opt/uc_newbuild/uClinux-dist
-fno-builtin -nostartfiles -I/opt/uc_newbuild/uClinux-dist/linux-2.0.x/include
-fname-mangling-version-0 -c -o hello.o hello.cpp
In file included from /opt/uc_newbuild/test/lib/gcc-lib/arm-elf/2.95.3/../../../../include/g++-3/libio.h:30,
from /opt/uc_newbuild/test/lib/gcc-lib/arm-elf/2.95.3/../../../../include/g++-3/streambuf.h:36,
from /opt/uc_newbuild/test/lib/gcc-lib/arm-elf/2.95.3/../../../../include/g++-3/iostream.h:31,
from hello.cpp:1:
/opt/uc_newbuild/test/lib/gcc-lib/arm-elf/2.95.3/../../../../arm-elf/include/_G_config.h:44: syntax error before `;'
make[2]: *** [hello.o] Error 1
make[2]: Leaving directory `/opt/uc_newbuild/uClinux-dist/user/hello'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/uc_newbuild/uClinux-dist/user'
make: *** [subdirs] Error 1
Can anyone help me on this? Thanks in advance.
Ivan Ng.
More information about the uClibc
mailing list