G++ - Linker returns error about PE ops on non-PE format

72 views
Skip to first unread message

Philip Muzzall

unread,
Sep 24, 2012, 7:52:41 PM9/24/12
to bareme...@googlegroups.com
Hello, pretty new to BMOS.

I'm trying to learn how to write and compile some C++ apps for BMOS, but the g++ linker always gives me the error about trying to perform PE operations on a non-PE format. Perhaps I'm missing a flag? Here's the command line I'm using:

"g++ -m64 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone -o App.o App.cxx libBareMetal.c -Ttext=0x200000 -T app.ld"

Ian Seyler

unread,
Sep 25, 2012, 12:20:47 PM9/25/12
to bareme...@googlegroups.com
Are you doing this on a Windows computer? Or in Linux?

-Ian

Philip Muzzall

unread,
Sep 25, 2012, 2:06:51 PM9/25/12
to bareme...@googlegroups.com
I'm using Windows with TDM-GCC 4.6.1

Ian Seyler

unread,
Nov 6, 2012, 2:05:51 PM11/6/12
to bareme...@googlegroups.com
I can't comment on C++ but I know the TDM-GCC compiler works with C.

Try something similar to this:
gcc -m64 -nostdlib -nostartfiles -nodefaultlibs -mno-red-zone -o hello.o hello.c libBareMetal.c -DBAREMETAL -Ttext=0x200000
objcopy -O binary hello.o hello.app
Reply all
Reply to author
Forward
0 new messages