hi!<br><br>so, i am trying running a simple app using c++, below following a code example.<br><br><b>jjpn@campinho hello$ </b>cat -n testecpp.cpp <br> 1 #include <stdio.h><br> 2 #include <stdlib.h><br>
3 #include <iostream><br> 4<br> 5 using namespace std;<br> 6<br> 7 class Teste {<br> 8 private:<br> 9 char texto[32];<br> 10<br> 11 public:<br> 12 Teste(void);<br>
13 ~Teste(void);<br> 14 static Teste *get(void);<br> 15 void setTexto(const char *texto);<br> 16 const char *getTexto(void);<br> 17 };<br>
18<br> 19 Teste::Teste(void)<br> 20 {<br> 21<br> 22 }<br> 23<br> 24 Teste::~Teste(void)<br> 25 {<br> 26<br> 27 }<br> 28<br> 29 Teste *Teste::get(void)<br> 30 {<br> 31 static Teste singleton;<br>
32 return &singleton;<br> 33 }<br> 34<br> 35 void Teste::setTexto(const char *texto)<br> 36 {<br> 37 strncpy(&this->texto[0], texto, sizeof(this->texto));<br> 38 }<br>
39<br> 40 const char *Teste::getTexto(void)<br> 41 {<br> 42 return &this->texto[0];<br> 43 }<br> 44<br> 45 int main(int main, char *argv[])<br> 46 {<br> 47 Teste teste;<br>
48 Teste *pteste = new Teste();<br> 49<br> 50 Teste::get()->setTexto("Jorge Pereira: singleton");<br> 51 pteste->setTexto("Jorge Pereira: pointer");<br> 52 teste.setTexto("Jorge Pereira: static");<br>
53<br> 54 cout << "Nome: singleton = " << Teste::get()->getTexto() << endl;<br> 55 cout << "Nome: pointer = " << pteste->getTexto() << endl;<br>
56 cout << "Nome: static = " << teste.getTexto() << endl;<br> 57<br> 58 printf("Hello World utilizando printf()\n");<br> 59<br> 60 delete pteste;<br>
61<br> 62 return 0;<br> 63 }<br> 64<br><b>jjpn@campinho hello$</b> <br><br>i am using a gcc/g++ below.<br><b>jjpn@campinho hello$</b> arm-uclinuxeabi-g++ -v<br>Using built-in specs.<br>Target: arm-uclinuxeabi<br>
Configured with: /scratch/paul/lite/uclinux/src/gcc-4.2/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-uclinuxeabi --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-shared --with-pkgversion=CodeSourcery Sourcery G++ Lite 2007q3-51 --with-bugurl=<a href="https://support.codesourcery.com/GNUToolchain/" target="_blank">https://support.codesourcery.com/GNUToolchain/</a> --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-uclinuxeabi/libc --with-build-sysroot=/scratch/paul/lite/uclinux/install/arm-uclinuxeabi/libc --enable-poison-system-directories --with-build-time-tools=/scratch/paul/lite/uclinux/install/arm-uclinuxeabi/bin --with-build-time-tools=/scratch/paul/lite/uclinux/install/arm-uclinuxeabi/bin<br>
Thread model: single<br>gcc version 4.2.1 (CodeSourcery Sourcery G++ Lite 2007q3-51)<br><b>jjpn@campinho hello$</b><br><br>compiling...<br><br><b>jjpn@campinho hello$</b> arm-uclinuxeabi-g++ -Os -pipe -fno-common -fno-builtin -Wall -nostdinc++ -I/opt/uClibc++/include -l:/opt/uClibc++/lib/libuClibc++.a -L/opt/uClibc++/lib/ -o testecpp.bin testecpp.cpp -Wl,-elf2flt="-r"<br>
<b>jjpn@campinho hello$ </b>file testecpp.bin<br>testecpp.bin: BFLT executable - version 4 ram<br><b>jjpn@campinho hello$ </b>ls -lh testecpp.bin<br>-rw-r--r-- 1 jjpn jjpn 61K 2008-03-07 13:19 testecpp.bin<br><b>jjpn@campinho hello$</b><br>
<br>when a try execute a BIN on board (LPC2468 from embedded artistis) a receive this message<br><br><b>#</b> cat /proc/version<br>Linux version 2.6.11.8-hsc0BEIJING (user@eadevenv) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from <a href="http://fiddes.net/coldfire/%29%28uClinux" target="_blank">http://fiddes.net/coldfire/)(uClinux</a> XIP and shared lib patches from <a href="http://www.snapgear.com/%29" target="_blank">http://www.snapgear.com/)</a>) #189 Wed Dec 26 16:06:12 CET 2007<br>
<b>#</b> ./testecpp.bin <br>Illegal instruction<br><b>#</b> <br><br>Questions!!<br><br>1) why this message appear?<br>2) exist any form to "running a c++ app in this board LPC2468 from embedded artists??<br><br>
My priority is compile using gcc/g++/threads 3.4 or better.<br><br>thankz a lot!<br>[]s<br><br><br><br><div class="gmail_quote">On Fri, Mar 7, 2008 at 12:16 PM, Martin Guy <<a href="mailto:martinwguy@yahoo.it" target="_blank">martinwguy@yahoo.it</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi!<br>
linux-arm is the list for linux kernel developers, not compilers or<br>
cross-compilers.<br>
What exactly are you trying to do? On what machine do you want to run<br>
the compiler? On the arm board itself?<br>
<font color="#888888"><br>
M<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>+ ---------------------------------------------------------------------------------+<br> Jorge Pereira, From: Olinda/Pe/Brazil<br> Home: <a href="http://www.jorgepereira.com.br/" target="_blank">http://www.jorgepereira.com.br/</a><br>
E-mail: <a href="mailto:jpereiran@gmail.com" target="_blank">jpereiran@gmail.com</a>, <a href="mailto:jorge@jorgepereira.com.br" target="_blank">jorge@jorgepereira.com.br</a><br> Mobile: +55 (81) 8833-2484<br> My Public Key: <a href="http://www.jorgepereira.com.br/public.pgp" target="_blank">http://www.jorgepereira.com.br/public.pgp</a><br>
+ ---------------------------------------------------------------------------------+<br> "Se você ama alguma coisa, liberte-a;<br> Se ela não voltar a ti, cace-a e mate-a."<br>+----------------------------------------------------------------------------------+