compiling C++ in the toolchain.
Nicolas Dufresne
nicolas.dufresne at gmail.com
Wed Jan 14 15:03:52 CET 2009
It's because you are using the C compiler instead of C++ compiler, that
compiler name should be :
arm-angstrom-linux-gnueabi-g++
Nicolas
Le mardi 13 janvier 2009 à 18:11 +0100, Peter Nijs a écrit :
> Hi,
>
> How can I lake the toolchain compile my code as C++ instead of C? Just
> compiling it like told in the wiki results in:
>
> peter at leela:/usr/local/openmoko/source/labyrinth> make
> make all-recursive
> make[1]: Entering directory `/usr/local/openmoko/source/labyrinth'
> Making all in src
> make[2]: Entering directory `/usr/local/openmoko/source/labyrinth/src'
> ccache arm-angstrom-linux-gnueabi-gcc -march=armv4t -mtune=arm920t -std=gnu99
> -DHAVE_CONFIG_H -I. -I.. -I.. -DPKGDATADIR=\"/usr/share/labyrinth\" -
> DTERMINAL_LOCALE_DIR=\""/usr/share/locale"\" -
> DPIXMAPDIR=\""/usr/share/pixmaps/labirynth"\" -DDATADIR=\""/usr/share"\" -
> D_GNU_SOURCE -isystem/usr/local/openmoko/arm/arm-angstrom-linux-
> gnueabi/include -Wall -pedantic -std=c99 -D_GNU_SOURCE=1 -D_REENTRANT -
> I/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/SDL -
> isystem/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/include -fexpensive-
> optimizations -fomit-frame-pointer -frename-registers -Os -MT main.o -MD -MP -
> MF .deps/main.Tpo -c -o main.o main.c
> main.c:9: warning: data definition has no type or storage class
> main.c:9: warning: type defaults to ‘int’ in declaration of ‘using’
> main.c:9: error: ‘std’ undeclared here (not in a function)
> main.c:9: error: expected ‘,’ or ‘;’ before ‘:’ token
> main.c:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
> ‘filename’
> main.c: In function ‘load_image’:
> main.c:13: warning: type of ‘filename’ defaults to ‘int’
> main.c:21: error: request for member ‘c_str’ in something not a structure or
> union
> make[2]: *** [main.o] Error 1
> make[2]: Leaving directory `/usr/local/openmoko/source/labyrinth/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/openmoko/source/labyrinth'
> make: *** [all] Error 2
>
>
> Which makes me think it's trying to compile it as C instead of C++. I tried to
> rename the source file to main.cpp (and of cource change all references to
> it). Now:
>
> peter at leela:/usr/local/openmoko/source/labyrinth> make
> make all-recursive
> make[1]: Entering directory `/usr/local/openmoko/source/labyrinth'
> Making all in src
> make[2]: Entering directory `/usr/local/openmoko/source/labyrinth/src'
> make[2]: *** No rule to make target `main.c', needed by `main.o'. Stop.
> make[2]: Leaving directory `/usr/local/openmoko/source/labyrinth/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/openmoko/source/labyrinth'
> make: *** [all] Error 2
>
> depeje
>
> _______________________________________________
> devel mailing list
> devel at lists.openmoko.org
> https://lists.openmoko.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/devel/attachments/20090114/e9d8d6f2/attachment-0001.htm
More information about the devel
mailing list