[SRC] Compiling resource ottdres.rc
gcc: and\: No such file or directory
gcc: Settings/Klaus/Desktop/ottd/msys/home/ottdsrc/trunk/media: No such file or directory
gcc: C:/Documents: No such file or directory
gcc: and: No such file or directory
gcc: Settings/Klaus/Desktop/ottd/msys/home/ottdsrc/trunk/src/ottdres.rc: No such file or directory
gcc: warning: `-x c' after last input file has no effect
gcc: no input files
c:\docume~1\klaus\desktop\ottd\mingw\bin\windres.exe: no resources
make[1]: *** [ottdres.o] Error 1
make[1]: Leaving directory `/home/ottdsrc/trunk/objs/release'
make: *** [all] Error 2
Is there anything we can do to the code to prevent that, or is it an error in the compiler?
I think when spaces in the path to find the file are causing problems this has nothing to do with the source code. It's a problem of the compiler apparently not being compatible with long paths on Windows. When you try to compile the game on Windows I'd highly recommend using Visual Studio. There's also a free C++ Visual Studio compiler.
Ok then, to clarify my question. Is there anything we can change in ottd source to force the use of short filenames (kernel32.dll has a function to return the path in short format) or do I have to write in the guide that mingw/msys cannot be installed to a path containing spaces?
Ill try to replicate the error in cygwin to see if it is specific for mingw.
Of course there is no problem like this in VS.
gcc: C:/Documents: No such file or directory
gcc: and: No such file or directory
gcc: Settings/Klaus/Desktop/ottd/msys/home/ottdsrc/trunk/src/ottdres.rc: No such file or directory
This error looks like the compiler is looking for the file C:/Documents and Settings/Klaus/Desktop/ottd/msys/home/ottdsrc/trunk/src/ottdres.rc, but since the path contains spaces, it actually look for 3 different files
C:/Documents
and
Settings/Klaus/Desktop/ottd/msys/home/ottdsrc/trunk/src/ottdres.rc
non of which really exists...
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!
LotP is correct; lose the spaces in the source paths and all will behave.
The proper solution would be to quote the whole mess in the makefile. Whoever wrote the makefile apparently forgot that you can never trust user input any farther than you can throw it. And since makefiles don't have exception handling, that's not very far at all.
I have found the cause of the problem to be outside the makefile and the ottd code.
It seems that msys converts any call to windres (and probably many other commands) into a win32 shell command and then the paths given in the parameters is converted as well. Unfortunatly not to the short filename version though.