News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

where i can change resources compiler option with TDM-GCC

Started by xiaomajia52, February 11, 2015, 04:00:01 AM

Previous topic - Next topic

xiaomajia52

i found that ,i can compile amd64 formatted windows bin file by TDM-GCC w64. :)

and compile i386 formatted windows execute file with "-m32" option after linker & compiler option.

but the compile log told me that it can't link resource (*.res format),it looks like the resource format is not matched.

and i googled,use windres,it can compile resource file into amd64 & i386 format bin file with option "-F pe-i386 or pe-amd64"

in TDM-GCC w64 ,the default option is "-F pe-amd64", so if i wanna build x86 bin file,i must add option "-F pe-i386" into windres when it compile the rc file.

but i can not find the blank where i can modify the resource compile option in codeblocks, :(

plz help me  :-* :-* :-*

-------------- Build: Release in gui (compiler: GNU GCC Compiler)---------------

x86_64-w64-mingw32-g++.exe -Wall -O2 -std=c++11 -m32  -c F:\WORK\GCC\gui\main.cpp -o obj\Release\main.o
F:\WORK\GCC\gui\main.cpp:36:35: warning: 'naked' attribute directive ignored [-Wattributes]
void __attribute__((naked)) test1()
                                   ^
windres.exe  -J rc -O coff -i F:\WORK\GCC\gui\resource.rc -o obj\Release\resource.res
x86_64-w64-mingw32-g++.exe  -o bin\Release\gui.exe obj\Release\main.o  obj\Release\resource.res -s -m32  -lgdi32 -luser32 -lkernel32 -lcomctl32 -mwindows
D:/Program/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `obj\Release\resource.res' is incompatible with i386 output
collect2.exe: error: ld returned 1 exit status

the true command is
windres.exe  -J rc -O coff -F pe-i386 -i F:\WORK\GCC\gui\resource.rc -o obj\Release\resource.res

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

xiaomajia52


MortenMacFly

The next nightly will have this implemented natively so you can change it per target/project etc...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]