Yet Another Compile Error

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Yet Another Compile Error

Post by kaan »

I'm using mingw with msys on Windows XP and i'm trying my best to improve the compile guide on the wiki.

The case is that whenever there is spaces in the path i get errors like this:

Code: Select all

[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?
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

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.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

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.
User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

by the looks of your error messages, you should really put the OTTD source code (not the compiler) in a path that doesn't contain spaces.

Code: Select all

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"!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

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.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

Thanks Dale, ill hunt in the makefile to see if it can be corrected then.
Last edited by kaan on 02 May 2007 12:15, edited 1 time in total.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

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.

I'm going to update the wiki to reflect this.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 12 guests