Bug #19259 2014-01-24 18:29

starbog

long filenames with "\" in -isystem compiler option error

On a Windows 7 system, using the included Mingw and CodeBlocks 13.12, passing a "-ISystem" directive to GCC when the path supplied is a long filename with spaces and the slash character is the default forward slash "\" results in compiling errors.

For example, in the Project/Build Options/Compiler Settings/Other Options field, if I include the following option:

-isystem "C:\Google Drive\Daemon\libtcod-1.5.2-gcc47\include\"

The following error is produced:

||=== Build: Debug in Daemon (compiler: GNU GCC Compiler) ===|

Drive\Daemon\Code\src\actor.cpp -o obj\Debug\src\actor.o||No such file or directory|

||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Note that it has split "C:\Google Drive\Daemon\libtcod-1.5.2-gcc47\include\" into ""C:\Google" and " Drive\Daemon\libtcod-1.5.2-gcc47\include\" and treated "C:\Google" as the value of the -isystem parameter, and is passing the rest as a filename to be compiled.

However, if I replace this option with:

-isystem "C:/Google Drive/Daemon/libtcod-1.5.2-gcc47/include/"

i.e. replace all the forward slashes with backwards slashes in the parameter for -isystem

Then this option is successfully passed to GCC and the build is successful.

Category
 
Group
 
Status
Open
Close date
 
Assigned to
 
starbog 2014-01-24 18:52

OK, I've had a look at the Codeblocks source.

It seems in the file plugins\compilergcc\compileroptionsdlg.cpp the method for handing "other options" (CompilerOptionsDlg::OptionsToText()) doesn't seem to have any handling for this case before it adds them to CompilerOptionsDlg:m_CompilerOptions ?

starbog 2014-01-24 19:07

Oops, apologies for not adding this to the correct category.

starbog 2014-01-24 20:11

Oops, apologies for not adding this to the correct category.

starbog 2014-01-24 20:15

Oops, apologies for not adding this to the correct category.