User forums > Help
Problems with resource path includes in VS2005 in simple program
DCKelley:
I am new to Code::Blocks but evaluating it for a project where we want the same IDE for VS2005~8~10 / Ubuntu, and an OMAP project, all to use GTK for the GUI as we move away from mother Microsoft. My need is to confirm our favorite code libraries can all be used across the 3 environments. For this Code::Blocks seems like the ideal choice. But I cannot seem to get even a simple Window MFC example (a dialog box, text, and a button) to run under Code Blocks as yet.
For the life of me I can’t get the resource compiler (rc.exe) to point to the include files. [cl.exe works fine] The various global compiler settings seem valid, and the search directory tab path values are all correct. I am running with a command line of:
rc.exe /I"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include" -fo"Release Win32\TestApp.res" TestApp.rc
and getting back:
TestApp.rc(11) : fatal error RC1015: cannot open include file 'afxres.h'.
The file 'afxres.h' happens to be the first include in the resources file. But rc is not seeing any of the ~\VC\include directory yet. If I move individual files to my working directory, it sees them and moves to the next one - but there must be some newbie dumb environment thing I am not doing here.
This was built from the “codeblocks-10.05mingw-setup.exe” release if that might matter, running on a Win7 64 bit OS.
Any Hints?
MortenMacFly:
--- Quote from: DCKelley on January 23, 2012, 09:31:57 am ---rc.exe /I"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include" -fo"Release Win32\TestApp.res" TestApp.rc
and getting back:
TestApp.rc(11) : fatal error RC1015: cannot open include file 'afxres.h'.
--- End quote ---
For me, in that folder you are including is no afxres.h (and never has been to my knowledge). So please provide the path to wherever that file is to the resource compiler.
stahta01:
FYI: Code::Blocks has separate search settings for resource Compiler.
Tim S.
DCKelley:
Duh, you are right, the include file is in a folder next to it, what it really seems to need is not the Q::B default value but:
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Include
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\include
I should have caught that. A few similar changes in the linker and resource compiler and we are on to the next oddity, the linker command line seems to play a bit loose with quotes and is getting confused after the output file file statement (note the bold part):
link.exe /nologo /subsystem:windows /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\lib\" /out:TestApp.exe "Release Win32\TestAppDlg.obj" "Release Win32\stdafx.obj" "Release Win32\TestApp.obj" "Release Win32\TestApp.res" /DEBUG /INCREMENTAL:NO
LINK : fatal error LNK1181: cannot open input file 'Win32\TestAppDlg.obj Release'
Process terminated with status 1181 (0 minutes, 0 seconds)
1 errors, 0 warnings
How can I get ->> /out:TestApp.exe <<- and not --> /out:TestApp.exe "Release <<-- here?
DCKelley:
A bit more, I just removed the spaces in the folder names (as this has caused me countless problem in the past with path parsing), but the result is still the same.
link.exe /nologo /subsystem:windows /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\lib\" /out:TestApp.exe Debug\TestAppDlg.obj Debug\stdafx.obj Debug\TestApp.obj Debug\TestApp.res
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : fatal error LNK1159: no output file specified
Process terminated with status 1159 (0 minutes, 0 seconds)
1 errors, 2 warnings
Navigation
[0] Message Index
[#] Next page
Go to full version