<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.3">
</HEAD>
<BODY>
It's because you are using the C compiler instead of C++ compiler, that compiler name should be :<BR>
arm-angstrom-linux-gnueabi-<B>g++</B><BR>
<BR>
Nicolas<BR>
<BR>
Le mardi 13 janvier 2009 &#224; 18:11 +0100, Peter Nijs a &#233;crit :
<BLOCKQUOTE TYPE=CITE>
<PRE>
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@leela:/usr/local/openmoko/source/labyrinth&gt; 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=\&quot;/usr/share/labyrinth\&quot; -
DTERMINAL_LOCALE_DIR=\&quot;&quot;/usr/share/locale&quot;\&quot; -
DPIXMAPDIR=\&quot;&quot;/usr/share/pixmaps/labirynth&quot;\&quot; -DDATADIR=\&quot;&quot;/usr/share&quot;\&quot; -
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 &#8216;int&#8217; in declaration of &#8216;using&#8217;                                                                                          
main.c:9: error: &#8216;std&#8217; undeclared here (not in a function)                                                                                                   
main.c:9: error: expected &#8216;,&#8217; or &#8216;;&#8217; before &#8216;:&#8217; token                                                                                                        
main.c:10: error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before 
&#8216;filename&#8217;                                                                         
main.c: In function &#8216;load_image&#8217;:                                                                                                                            
main.c:13: warning: type of &#8216;filename&#8217; defaults to &#8216;int&#8217;                                                                                                     
main.c:21: error: request for member &#8216;c_str&#8217; 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@leela:/usr/local/openmoko/source/labyrinth&gt; 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
<A HREF="mailto:devel@lists.openmoko.org">devel@lists.openmoko.org</A>
<A HREF="https://lists.openmoko.org/mailman/listinfo/devel">https://lists.openmoko.org/mailman/listinfo/devel</A>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>