Author Topic: where i can change resources compiler option with TDM-GCC  (Read 5176 times)

Offline xiaomajia52

  • Single posting newcomer
  • *
  • Posts: 2
where i can change resources compiler option with TDM-GCC
« on: February 11, 2015, 04:00:01 am »
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
« Last Edit: February 11, 2015, 04:18:09 am by xiaomajia52 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: where i can change resources compiler option with TDM-GCC
« Reply #1 on: February 11, 2015, 05:46:21 am »
Read this thread and see if it helps. I would try jens method.

http://forums.codeblocks.org/index.php/topic,14239.msg95776.html#msg95776

If that is a bad fit; you can try the method I suggested to another person here.
http://forums.codeblocks.org/index.php/topic,19445.msg132846.html#msg132846

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline xiaomajia52

  • Single posting newcomer
  • *
  • Posts: 2
Re: where i can change resources compiler option with TDM-GCC
« Reply #2 on: February 11, 2015, 06:59:05 am »
thank you !it works perfectly! ;D

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: where i can change resources compiler option with TDM-GCC
« Reply #3 on: February 11, 2015, 08:03:05 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ