Author Topic: windres embed DLL in resource  (Read 6689 times)

DaveHope

  • Guest
windres embed DLL in resource
« on: April 06, 2009, 09:19:34 am »
Code
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:
Code
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


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: windres embed DLL in resource
« Reply #1 on: April 06, 2009, 09:57:26 pm »
Code
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
Code
""

Smart
Code
“”

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

DaveHope

  • Guest
Re: windres embed DLL in resource
« Reply #2 on: April 07, 2009, 09:10:56 am »
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:

Code
IDR_PKEY_DLL BINARY MOVEABLE PURE “ProductKeyFinder.dll”

Still errors with:

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

Any other ideas?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: windres embed DLL in resource
« Reply #3 on: April 08, 2009, 05:04:37 am »
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
« Last Edit: April 08, 2009, 05:10:44 am by stahta01 »
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 stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: windres embed DLL in resource
« Reply #4 on: April 08, 2009, 05:54:35 am »
I have gotten it to compile; did not test it it works at runtime.


I added this code to an working rc file.
Code
#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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org