News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

windres embed DLL in resource

Started by DaveHope, April 06, 2009, 09:19:34 AM

Previous topic - Next topic

DaveHope

Hi,

I'm struggling to embed a DLL in a resource (.rc) file. windres complains with:

[code]Compiling: resource.rc
windres.exe: resource.rc:17: syntax error


From what I can tell, everything is setup correctly. In my header I have:

[code// ID of the embedded DLL.
#define IDR_PKEY_DLL 102[/code]

And then in the rc I have:
IDR_PKEY_DLL BINARY MOVEABLE PURE "res\\Project.dll"

I'm pretty sure that's worked with Microsofts resource compiler as part of VC++ (euck!), but not windres. Any ideas?

Thanks,

Dave


stahta01

Quote from: DaveHope on April 06, 2009, 09:19:34 AM
IDR_PKEY_DLL BINARY MOVEABLE PURE "res\\Project.dll"

Two suggestions; one of the windres had issues using the folder name res I would try resource name instead
Two, Use the proper double quote character not the smart double quote characters

Regular
""

Smart
""

Tim S
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]

DaveHope

Thanks for the reply Tim.

Sorry for messing up the code tags in the original post, not sure what happened there.

I've removed the res/resource folder altogether, but the problem persists. I've also tried the smart tags as suggested without much luck:

IDR_PKEY_DLL BINARY MOVEABLE PURE "ProductKeyFinder.dll"

Still errors with:

Compiling: resource.rc
windres.exe: C:\\Users\\DAVEHO~1\\Desktop\\2.0\\DEVEL\\resource.rc:17: syntax error


Any other ideas?

stahta01

#3
Yeah, use regular quotes NOT smart quotes as I said the first time.

Note: I have never heard of embedding an DLL inside an exe using an resource file; so, I have no idea if it works using MinGW windres.exe. 

Tim S
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]

stahta01

I have gotten it to compile; did not test it it works at runtime.


I added this code to an working rc file.

#define IDR_TBEHK_DEBUG 130

IDR_TBEHK_DEBUG BINARY  MOVEABLE PURE   "icudt41.dll"


I then added the path to the DLL file "icudt41.dll" under this location in Code::Blocks

Project -> Build Options
Tab "search directory"
SubTab "Resource Compiler"

I used a relative path, but an full path should work.

Tim S
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]