Author Topic: Error windress can't popen  (Read 14753 times)

Offline mario_mc

  • Single posting newcomer
  • *
  • Posts: 3
Error windress can't popen
« on: August 05, 2013, 10:45:57 am »
I have different problem which i hasn't found on the forums or guides.
after installing code :: block with MinGW and compile wxWidegets2.9.5 using:
SHARED=1 
MONOLITHIC=1 
UNICODE=1
when I create new project following by instruction
everything's fine but when i run and build project it appear a error:
windres.exe: can't popen `gcc -E -xc -DRC_INVOKED -ID:\wxWidgets-2.9.5\include -ID:\wxWidgets-2.9.5\lib\gcc_dll\mswu D:MyProject\test\resource.rc': No such file or directory
I have no idea what is causes problem please help

Reply

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #1 on: August 05, 2013, 02:13:31 pm »
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

FYI: We here have no idea why you will NOT post the information requested in the link posted twice for you.

Posting a full re-build log would likely help us to help you.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
« Last Edit: August 06, 2013, 12:20:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #2 on: August 12, 2013, 05:05:08 pm »
Hello, All ( and exclusively stahta01).

I am running Code::Blocks  ver. 12.11 Build: Nov 25 2012, 09:32:38 - wx2.8.12 (Windows, unicode - 32bit)
on WindowsXP Pro 2002 SP3. The compiler I use is MinGW ver. 4.7.1
(http://garr.dl.sourceforge.net/project/codeblocks.berlios/codeblocks-12.11mingw-setup_user.exe)

When I build new project ( File -> New -> Project -> Win32 GUI project -> Dialog based -> ... -> Build) 
I see next
"-------------- Build: Debug in Dialog (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g     -c D:\pjx\CB\Dialog\main.cpp -o obj\Debug\main.o
windres.exe  -J rc -O coff -i D:\pjx\CB\Dialog\resource.rc -o obj\Debug\resource.res
windres.exe: can't popen `gcc -E -xc -DRC_INVOKED  D:\pjx\CB\Dialog\resource.rc': No such file or directory
Process terminated with status 1 (0 minutes, 6 seconds)
1 errors, 0 warnings (0 minutes, 6 seconds)
"
No additions, no deletions in any project files.

Frame based Win32 GUI projects built successfully.

With best wishes...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #3 on: August 12, 2013, 06:26:39 pm »
Works for me.

Code
-------------- Build: Debug in TestWinGUI (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g     -c V:\SourceCode\CBProjects\TestProjects\TestWinGUI\main.cpp -o obj\Debug\main.o
windres.exe  -J rc -O coff -i V:\SOURCE~1\CBPROJ~1\TESTPR~1\TESTWI~2\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe  -o bin\Debug\TestWinGUI.exe obj\Debug\main.o  obj\Debug\resource.res   -lgdi32 -luser32 -lkernel32 -lcomctl32
Output size is 32.63 KB

Your MinGW Compiler installation is likely missing "gcc.exe".

I am testing on Windows 7 32-bit and CB 12.11 using MinGW that came with  CB 12.11.

What I get on Windows 7 if gcc.exe does NOT exist.

Code
mingw32-g++.exe -Wall  -g     -c V:\SourceCode\CBProjects\TestProjects\TestWinGUI\main.cpp -o obj\Debug\main.o
windres.exe  -J rc -O coff -i V:\SOURCE~1\CBPROJ~1\TESTPR~1\TESTWI~2\resource.rc -o obj\Debug\resource.res
'gcc' is not recognized as an internal or external command,
operable program or batch file.
windres.exe: preprocessing failed.

For anymore help from me; I need your CB Tool chain setting value for Compiler Installation Directory.
My guess is it is NOT using the correct MinGW GCC.

Tim S.
« Last Edit: August 12, 2013, 06:34:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #4 on: August 12, 2013, 06:55:45 pm »
Compiler settings -> Global compiler settings -> Toolchain executables -> Compiler's installation directory = D:\CodeBlocks\MinGW
If "D:\CodeBlocks\MinGW" is NOT correct MinGW GCC then what is more correct?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #5 on: August 12, 2013, 07:13:14 pm »
Compiler settings -> Global compiler settings -> Toolchain executables -> Compiler's installation directory = D:\CodeBlocks\MinGW
If "D:\CodeBlocks\MinGW" is NOT correct MinGW GCC then what is more correct?

Does the file D:\CodeBlocks\MinGW\bin\gcc.exe exist?

Edit: If it does exist what does the below in a cmd.exe window give

Code
cd /d D:\CodeBlocks\MinGW\bin
gcc.exe -v

Tim S.
« Last Edit: August 12, 2013, 07:18:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #6 on: August 12, 2013, 07:15:27 pm »
Definitely YES.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #7 on: August 12, 2013, 07:19:14 pm »
What does the below in a cmd.exe window give

Code
cd /d D:\CodeBlocks\MinGW\bin
gcc.exe --version

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #8 on: August 12, 2013, 07:23:21 pm »
Of course
"D:\CodeBlocks\MinGW\bin>gcc --version
gcc.EXE (tdm-1) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
"

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #9 on: August 12, 2013, 07:27:07 pm »
Try this command and see if it works on the CMD.exe

Code
gcc -E -xc -DRC_INVOKED  D:\pjx\CB\Dialog\resource.rc

You will likely need to be in the "D:\CodeBlocks\MinGW\bin" folder or add it to your system path.

If it works or fails try this below commands

Code
SET PATH=D:\CodeBlocks\MinGW\bin;%PATH%
cd /d D:\pjx\CB\Dialog

mingw32-g++.exe -Wall  -g     -c D:\pjx\CB\Dialog\main.cpp -o obj\Debug\main.o
windres.exe  -J rc -O coff -i D:\pjx\CB\Dialog\resource.rc -o obj\Debug\resource.res

If the above works, it implies a problem in Code::Blocks.
If it fails, it implies a Compiler related issue. Compiler Installation or conflict issue being most likely.

Edit: If it fails, you should verify D:\pjx\CB\Dialog\resource.rc exists before thinking it is a compiler issue.

Tim S.
« Last Edit: August 12, 2013, 07:44:44 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #10 on: August 12, 2013, 07:49:01 pm »
"gcc -E -xc -DRC_INVOKED  D:\pjx\CB\Dialog\resource.rc" returns many lines, no errors.

After "set path" and "cd d:\..."
"mingw32-g++.exe -Wall  -g     -c D:\pjx\CB\Dialog\main.cpp -o obj\Debug\main.o" returns no message, obj\Debug\main.o file appears.
"windres.exe  -J rc -O coff -i D:\pjx\CB\Dialog\resource.rc -o obj\Debug\resource.res" returns no message, obj\Debug\resource.res file appears.

What is my next step?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #11 on: August 12, 2013, 08:06:25 pm »
"gcc -E -xc -DRC_INVOKED  D:\pjx\CB\Dialog\resource.rc" returns many lines, no errors.

After "set path" and "cd d:\..."
"mingw32-g++.exe -Wall  -g     -c D:\pjx\CB\Dialog\main.cpp -o obj\Debug\main.o" returns no message, obj\Debug\main.o file appears.
"windres.exe  -J rc -O coff -i D:\pjx\CB\Dialog\resource.rc -o obj\Debug\resource.res" returns no message, obj\Debug\resource.res file appears.

What is my next step?

I really have no idea; I might try a prior version of Code::Blocks (8.?? or 10.??) or a current nightly and see if the problem still exists in CB.

I am guessing a CB and Windows XP related bug.

Tim S.
« Last Edit: August 12, 2013, 08:08:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Error windress can't popen
« Reply #12 on: August 12, 2013, 08:12:30 pm »
I have a possible work around; but, it may or may not work.

Changing adv compiler options did NOT work for me.

But, changing tool chain exe for resource compiler did seem to work it was "windres.exe" I changed it to "windres.exe --use-temp-file"
This might fix it under windows XP; but, it is just a guess.

I am hoping that it is a popen and windows XP caused CB related bug. The option "--use-temp-file" stops the use of popen in the windres call.

Tim S.
« Last Edit: August 12, 2013, 08:29:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PinkPanther

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error windress can't popen
« Reply #13 on: August 12, 2013, 08:48:52 pm »
Yes, adjustment  "windres.exe" to "windres.exe --use-temp-file" fix it.
Thank you very much.

PS: But it's so regretable...

robertkendrick

  • Guest
Re: Error windress can't popen
« Reply #14 on: October 28, 2013, 07:57:40 pm »
Hi there.

Nice product.

I had this same problem as above with windres (xxx.rc no such file or directory). Using 12.11 and combined MinGW.

After trying moving MinGW (for no spaces) and using GCC command in advanced build for the individual rc file (without success) I found that editing the toolchain in settings->compiler from:
windress
to
windress -v

also appears to fix the problem (and still uses popen ??).

I HAVE NO IDEA WHY -- but thought it may help to track down the bug.

regards