[Solved] Problem to add .rc to .exe

BlitzMax Forums/Brucey's Modules/[Solved] Problem to add .rc to .exe

MOBii(Posted 2016) [#1]
After I Upgrade to TDM MinGW 64bit 5.1.0-2
I get this:
*********************[Start :: Building Project]***
C:\MOBii\BLL>cd C:\BlitzMax\MOBii\BLL\

C:\BlitzMax\MOBii\BLL>windres -iBuild\BLL.rc -oBuild\BLL.o

C:\BlitzMax\MOBii\BLL>C:\BlitzMax\bin\bmk makeapp -r -t gui EDii.bmx
[ 99%] Processing:EDii.bmx
[ 99%] Compiling:EDii.bmx.gui.release.win32.x86.s
flat assembler  version 1.69.14  (1024457 kilobytes memory)
4 passes, 14887 bytes.
[100%] Linking:EDii.exe
C:\Wello\MinGW/bin/ld.exe: skipping incompatible C:/BlitzMax/MOBii/BLL/Build/BLL.o when searching for C:/BlitzMax/MOBii/BLL/Build/BLL.o
C:\Wello\MinGW/bin/ld.exe: skipping incompatible C:/BlitzMax/MOBii/BLL/Build/BLL.o when searching for C:/BlitzMax/MOBii/BLL/Build/BLL.o
C:\Wello\MinGW/bin/ld.exe: cannot find C:/BlitzMax/MOBii/BLL/Build/BLL.o
Build Error: Failed to link C:/BlitzMax/MOBii/BLL/EDii.exe
skipping incompatible C:/BlitzMax/MOBii/BLL/Build/BLL.o

I compile: x86 and no multithreaded version
I don't get any Error message from: windres -iBuild\BLL.rc -oBuild\BLL.o
this was working in my MinGW 4.7.1
I get same Error in BLIDE now..
EDii.exe get compiled but BLL.o is not included


BLL.rc:
101 ICON "C:\\BlitzMax\\MOBii\\BLL\\images\\icon.ico"
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x40004
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
	BLOCK "040904B0"
	{
		VALUE "CompanyName", "..."
		VALUE "FileDescription", "..."
		VALUE "FileVersion", "0.97a"
		VALUE "InternalName", "..."
		VALUE "LegalCopyright", "..."
		VALUE "OriginalFilename", "EDii.exe"
		VALUE "ProductName", "BLL"
		VALUE "ProductVersion", "..."
	}
}

BLOCK "VarFileInfo"
{
	VALUE "Translation", 0x0409, 0x04B0
}
}
24 "C:\\BlitzMax\\MOBii\\BLL\\Build\\data.bin"
data.bin:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
   manifestVersion="1.0">
<description>Windows forms common control manifest</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
   name="Microsoft.Windows.Common-Controls"
   version="6.0.0.0" processorArchitecture="x86"
   publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
I download the latest resource_hacker 4.2.5

If I add the information directly in Resource Hacker the icon adds to the .exe but the .exe become corrupt

Someone have similar problem?


grable(Posted 2016) [#2]
Since your using a 64-bit version of mingw, windres will produce 64-bit objects by default.
You need this switch for it to produce 32-bit ones:
-F pe-i386



MOBii(Posted 2016) [#3]
Thank thee grable -F pe-i386 had no impact on C:\BlitzMax\bin\bmk.exe
(I misunderstand this)

the New working compile script:
@set BLHTML_Path=C:\BlitzMax\MOBii\BLL
@set BLHTML_Build_this=EDii
@set BLHTML_Compression=-best
@set BLHTML_Run_when_DONE=0

cd %BLHTML_Path%
del %BLHTML_Build_this%.exe
del Build\Log.txt

@echo ************************************************[Start :: Compiling Project]***
@echo ************************************************************[windres :: res]***
C:\Wello\MinGW\bin\windres -F pe-i386 -iBuild\BLL.rc -oBuild\BLL.o

@echo ************************************************************[Compile :: bmx]***
C:\BlitzMax\bin\bmk makeapp -r -h -t gui %BLHTML_Build_this%.bmx
move %BLHTML_Build_this%.exe tmp.exe
del %BLHTML_Build_this%.exe
upx -%BLHTML_Compression% -o%BLHTML_Build_this%.exe tmp.exe --compress-icons=2
@del tmp.exe

@if %BLHTML_Run_when_DONE% gtr 0 (
	%BLHTML_Build_this%
)
@echo **********************************************************************[DONE]***
@echo Have a nice day
PAUSE
BLIDE still can't build a release version!


grable(Posted 2016) [#4]
That switch was for windres, the tool that builds resources.


MOBii(Posted 2016) [#5]
hehe Thank thee grable, Work perfectly now when I put -F pe-i386 in windres!
I update the .bat compile script


grable(Posted 2016) [#6]
No problem dude :)