TDM-GCC w64脚本更改windres为32位? [英] TDM-GCC w64 script to change windres for 32bit?

查看:736
本文介绍了TDM-GCC w64脚本更改windres为32位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试获取在XP SP3上运行的TDM-GCC(4.7.1) - 我现在只需要一个c + 32位的版本。似乎windres是不正确的格式,我的.rc文件是失败的构建:

  x86_64-w64-mingw32- g ++。exe -Wall -m32 -s -D_M_X86 -DBUILD_DLL -DNDEBUG -c C:\SynthEditSDK\TD_SV\SV.cpp -o obj \Release\TD_SV\SV.o 
windres。 exe -J rc -O coff -i C:\SYNTHE〜1 \TD_SV\TD_SV.rc -o obj\Release\TD_SV\TD_SV.res
x86_64-w64-mingw32-g ++。 exe -shared -Wl, - output-def = bin\Release\libTD_SV -Wl, - out-implib = bin\Release\libTD_SV -Wl, - dll obj\Release\se_sdk3\ mp_sdk_audio.o obj\Release\se_sdk3\mp_sdk_common.o obj\Release\TD_SV\SV.o obj\Release\TD_SV\TD_SV.res -o bin\Release\TD_SV.sem -Wl, - kill-at -static-libgcc -m32 -luser32
c:/ mingw / bin /../ lib / gcc / x86_64-w64-mingw32 / 4.7.1 /../../。 ./../x86_64-w64-mingw32/bin/ld.exe:i386:x86-64输入文件体系结构obj \Release\TD_SV\TD_SV.res与i386输出不兼容
collect2 .exe:错误:ld返回1退出状态
进程以状态1(0分钟,2秒)终止
0错误,2警告(0分钟,2秒)

我的资源文件(TD_SV.rc)似乎是错误:

  TD_SV.res'与i386输出不兼容

已经搜索了几个小时,最近我得到一个解决方案在这里:



http://backyardcode.com/



他建议这个脚本 - 但我不知道如何更改它以适应我的需要 - 任何帮助赞成!








$ b $ p Debug32))
||
GetProjectManager()。GetActiveProject()。GetActiveBuildTarget()。Matches(_T(Release32)))
{print(_T( - D USE_X86_MODE -F pe-i386)); }]] -i $ file -J rc -o
$ resource_output -O coff $ res_includes


任何TDM-GCC(预建/安装类型)替代?我真正需要的是32位构建与石墨选项。也使用CodeBlocks IDE。



尊重
Andrew

解决方案

要查看所有可用的windres参数,您可以请求帮助:


x86_64-w64-mingw32-windres.exe --help


对于Windows 32位格式,您需要使用 pe-i386 目标的 coff 格式。 / p>

基本上,您必须先添加 -F pe-i386 (或 - target = pe-i386



在GNU自动工具中,它是关于 RCFLAGS -O coff 。所以如果有一些配置脚本,只需添加


./configure RCFLAGS = - output-format = coff - i386........



Trying to get the TDM-GCC(4.7.1) running on XP SP3 - I just need a c++ 32bit build for now. It seems that windres is not in the right format, my .rc file is failing the build:

x86_64-w64-mingw32-g++.exe  -Wall -m32 -s -D_M_X86 -DBUILD_DLL -DNDEBUG     -c C:\SynthEditSDK\TD_SV\SV.cpp -o obj\Release\TD_SV\SV.o
windres.exe  -J rc -O coff -i C:\SYNTHE~1\TD_SV\TD_SV.rc -o obj\Release\TD_SV\TD_SV.res
x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=bin\Release\libTD_SV -Wl,--out-implib=bin\Release\libTD_SV -Wl,--dll  obj\Release\se_sdk3\mp_sdk_audio.o obj\Release\se_sdk3\mp_sdk_common.o obj\Release\TD_SV\SV.o  obj\Release\TD_SV\TD_SV.res  -o bin\Release\TD_SV.sem -Wl,--kill-at  -static-libgcc -m32  -luser32 
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `obj\Release\TD_SV\TD_SV.res' is incompatible with i386 output
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 2 warnings (0 minutes, 2 seconds)

My resource file(TD_SV.rc) seems to be the error:

TD_SV.res' is incompatible with i386 output

I've been googling for hours and the closest I got to a solution is here:

http://backyardcode.com/

He suggests this script - but I can't figure out how to change it to suit my needs - Any help appreciated!

$rescomp [[ if(GetProjectManager().GetActiveProject().GetActiveBuildTarget().Matches(_T("Debug32")) || GetProjectManager().GetActiveProject().GetActiveBuildTarget().Matches(_T("Release32"))) { print(_T("-D USE_X86_MODE -F pe-i386")); } ]] -i $file -J rc -o $resource_output -O coff $res_includes

Also - is there any TDM-GCC (pre-built/installer type) alternatives? All I really need is 32bit build with graphite options. Also using CodeBlocks IDE.

Regards Andrew

解决方案

To see all possble windres parameters, you can request help:

x86_64-w64-mingw32-windres.exe --help

For Windows 32 bit format you need coff format with pe-i386 target.

Basically, you have to add -F pe-i386 (or --target=pe-i386) after -O coff flag to your command line if you generate it manually.

In GNU autotools it's about the RCFLAGS. So if there's some configure script, just add

./configure RCFLAGS="--output-format=coff --target=pe-i386" ........

这篇关于TDM-GCC w64脚本更改windres为32位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆