Hi,

I am trying to run a simple C++ application on uClinux 2.6.16 on a M5272C3 board. The program is:
*#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
   cout << "Hello this is my First uClinux C++ Application\n" << endl;
   return 0;
}
*
The following command was used to cross compile the above program:
*m68k-elf-g++ -Wl,-elf2flt=-z -m5307 -msep-data -o hello hello.cpp -lstdc++ -lc -lgcc*

On executing the program i got the following error:
*Support for ZFLAT executable is not enabled
Shell invoked to run file: ./hello
Command:bFLT
bFLT: Bad command or file name*

So i enabled the ZFLAT flag in */linux-2.6.x/.config: CONFIG_BINFMT_ZFLAT=y*

Now on executing i get the following error:
*BINFMT_FLAT: reloc outside program 0xe70b2385 (0 - 0x55f54/0x4e1c0), killing hello!*

The -v option gives the following output:
*Using built-in specs.
Target: m68k-uclinux
Configured with: /home/gerg/src/gnu/m68k-elf/autobuild/gcc-4.1.1/configure --target=m68k-uclinux --with-headers=/home/gerg/src/gnu/m68k-elf/autobuild/linux-2.6.16/include --enable-multilib --disable-shared --enable-languages=c,c++
Thread model: single
gcc version 4.1.1
/usr/local/libexec/gcc/m68k-uclinux/4.1.1/cc1plus -quiet -v hello.cpp -quiet -dumpbase hello.cpp -m5307 -msep-data -auxbase hello -version -o /tmp/cceXhv34.s
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../include/c++/4.1.1
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../include/c++/4.1.1/m68k-uclinux
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../include/c++/4.1.1/backward
/usr/local/lib/gcc/m68k-uclinux/4.1.1/include
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../m68k-uclinux/sys-include
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../m68k-uclinux/include
End of search list.
GNU C++ version 4.1.1 (m68k-uclinux)
       compiled by GNU C version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64380
Compiler executable checksum: 90445088d955ace4286be708685ff232
/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../m68k-uclinux/bin/as -m5307 --pcrel -o /tmp/ccrli2Sv.o /tmp/cceXhv34.s /usr/local/libexec/gcc/m68k-uclinux/4.1.1/collect2 -o hello /usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../m68k-uclinux/lib/m5307/msep-data/crt0.o -L/usr/local/lib/gcc/m68k-uclinux/4.1.1/m5307/msep-data -L/usr/local/lib/gcc/m68k-uclinux/4.1.1/../../../../m68k-uclinux/lib/m5307/msep-data -elf2flt=-z /tmp/ccrli2Sv.o -lstdc++ -lgcc -lstdc++ -lm -lc -lgcc -lc -lgcc*

What do i do? Help!
PS: A similar C application runs perfectly fine and prints the output.

Thanks,
Praveen C


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to