"[Resource Error] - preprocessing failed" Error in

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
Emad4000
In need of some credit
In need of some credit
Posts: 3
Joined: Mon May 18, 2009 8:08 am
Contact:

"[Resource Error] - preprocessing failed" Error in

Post by Emad4000 »

hi everybody
i'm writing a program by wxDevCpp that uses wxWidget GUI Library
the last time that i changed my code and pressed the "Compile&Run" Button i get this Error from Compiler :

Code: Select all

[Resource Error] les\Dev-Cpp\Bin\windres.exe: preprocessing failed.
C:\Documents and Settings\Ali\My Documents\Makefile.win [Build Error] exe: *** [Objects/MingW/Test64_private.res] Error 1
at now i can't run none of my progs. in every project i face with this error, (including an empty new project)
i try a lot (include reinstalling the wxDevC++) to solve the problem but i don't reach to any success.

please help me.tanx.
You Can Win
If You Want :)
spepe
In need of some credit
In need of some credit
Posts: 3
Joined: Thu Jun 04, 2009 3:32 pm

Post by spepe »

Hello!

I am having the exact same problem on Windows 7!

When I try to compile a project, even if it is an empty wxFrame project, it says the same error message!

I think it is some kind of a WinAPI problem or what. :) Sorry, I am not too good at this things right now, as this is the second or third time I am trying do make a GUI app. :)

Any help, and correction would be appreciated!! :)

Thanks in advance and sorry for my English!

Bye!
Emad4000
In need of some credit
In need of some credit
Posts: 3
Joined: Mon May 18, 2009 8:08 am
Contact:

Post by Emad4000 »

finally i changed the OS (windows) and the problem solved :)
i hope that will be the last occurrence of this error
You Can Win
If You Want :)
mraman
In need of some credit
In need of some credit
Posts: 5
Joined: Tue Jul 28, 2009 10:23 am

Post by mraman »

I too faced this problem building the example files that come with wxWidget on wxDev-C++. I was hoping to see a reply to your query.
In the meantime, I went to the project options and disabled include in compilation option and the project got built :o
mraman
In need of some credit
In need of some credit
Posts: 5
Joined: Tue Jul 28, 2009 10:23 am

Post by mraman »

After some research I have some feel for what's happening and likely source of the problem

First it is do with compilation of the .rc file using windres compiler
o WxDev-c++ does some jugglery and creates a filename##_private.res which basically includes the original filename.rc and tries compiling this.
o filename.rc includes a file wx\msw\wx.rc which is not to be found. this file probably is in install directory (in my case c:\program files\dev-cpp) \include\common.
o Added this directory to the resource directories, but still did not help
o did a make -f makefile.win on the dos prompt and noticed the following:
- file wx\string.h has a
# include <string> in line 176.
there is no such file anywhere and btw the file that includes this line is already named string.h

any one has clues, if my research and hunch is right?

As mentioned in my previous post, disabling the .rc file from compilation gets you going, except that the .exe does not have an icon attached on execution. Getting the rc compiler to work would be needed for more serious stuff that need resources.

appreciate any expert help on this
regards
Raman
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina »

I think the problem is that wxDev-C++ is installed in a directory who's path includes spaces. We've seen some systems where this works and others where it doesn't. On my system, spaces in the path name are handled just fine. However, on yours it might not be.

-Tony
Everybody's got something to hide except for me and my monkey.
mraman
In need of some credit
In need of some credit
Posts: 5
Joined: Tue Jul 28, 2009 10:23 am

Post by mraman »

tbreina wrote:I think the problem is that wxDev-C++ is installed in a directory who's path includes spaces. We've seen some systems where this works and others where it doesn't. On my system, spaces in the path name are handled just fine. However, on yours it might not be.

-Tony
Well, that leaves me nowhere. Is reinstalling wxDev-C++ a possible solution? It happens only to .rc files (windres). What is string in #include <string>? a macro? a typo? what file is it referring to?

thanks
Raman
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina »

No need to get snappy...

I would first test to see if that is really the only problem. You can deactivate the resource compiler part by going to Project->Project Options->Files. Click on the rc file (e.g. Project1App.rc) On the right, you'll see a checkbox that says "Include in compilation". Uncheck this box. Click the OK button and then rebuild your project (Execute->Rebuild All). Assuming that was the only problem, then it should build cleanly.

As far as the #include <string>, this is a standard C++ library for strings. I did a simple google search and turned up this: http://en.wikipedia.org/wiki/String_(C%2B%2B).

-Tony
Everybody's got something to hide except for me and my monkey.
hackish
Knows some wx things
Knows some wx things
Posts: 41
Joined: Sat Aug 22, 2009 12:02 pm
Contact:

Post by hackish »

I know this is an older topic but I just installed wxdev on my desktop machine vista (64 bit) and it came up with the following error:
[Resource Error] les (x86)\Dev-Cpp\Bin\windres.exe: preprocessing failed.

I suspect that this error is coming not from the fact that there are spaces in the filename but the () which is a standard program files directory for the 64 bit versions of windows. I tried the disable .rc file trick but the error still comes up. Not really sure where to look next.

Aha found some more info that might help... (sensitive path names removed)

Code: Select all

Compiler: Default GCC compiler
Building Makefile: "M:\projects\blah\Makefile.win"
Executing  make...
mingw32-make.exe -f "Makefile.win" all 
"windres.exe" --input-format=rc -o Objects/MingW/blah_private.res --include-dir "C:/PROGRA~2/Dev-Cpp/include/common" Objects/MingW/PCS4A4~N.RC -O coff

'c:\Program' is not recognized as an internal or external command,
operable program or batch file.

c:\Program Files (x86)\Dev-Cpp\Bin\windres.exe: preprocessing failed.

mingw32-make.exe: *** [Objects/MingW/blah_private.res] Error 1

Execution terminated
Compilation Failed. Make returned 2

-Michael
hackish
Knows some wx things
Knows some wx things
Posts: 41
Joined: Sat Aug 22, 2009 12:02 pm
Contact:

Post by hackish »

Ok, here is a workaround... I suspect the bug actually lies in the makefile generation but I don't know how to get it to spit out the Makefile so I can examine it...

You need to find the old 8.3 compatible windows filename for your path. You can use the following command:
DIR /X

Take the path where you installed mingw and change it to the 8.3 format which gets past the space problem.

In WxDev-c++ go to the tools menu, compiler options.
Select the directories tab
Under binaries replace the directory with it's short filename version... For me it was:
originally
c:\program files (x86)\dev-cpp\bin
so I changed it to:
c:\progra~2\dev-cpp\bin

-Michael
alex8toh
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Feb 06, 2014 9:46 am

Re: "[Resource Error] - preprocessing failed" Error in

Post by alex8toh »

I think the easier fix would be to reinstall wxDev-C++ to c:\Dev-Cpp. :P :D
Post Reply