Does the linker in VC2008 have problems with spaces in the tracks?

The previous question I asked was how I can use the .lib file with the VC2008 project, and the answers were very helpful. Now another problem has appeared - for example. my .h and .lib files are in the c: \ pcm folder. I indicate this path in the necessary places (c / C ++ → include include, linker-> input-> additional dependencies). Everything works great.

but when I change the path to "c: \ pc m" (note the space) and reflect this change in the necessary places: linker-> input and additional include directories, etc.

Now on building I get: Error1 of fatal error LNK1104: cannot open file 'c: \ pc.obj'

what is the solution to this problem?

thanks.

+4
source share
3 answers

An almost universal answer to problems with spaces in path / file names:

  • enter the path / file name in quotation marks.

Note that this works even if you use the VS macro as part of the name:

"$(OutDir)\foo.lib" 

works (while without quotes, it breaks due to spaces in the $(OutDir) macro).

+4
source

I have never had a problem with this.

+1
source

Using double quotes around path names is reasonable. This is necessary when they contain spaces. Send the compilation command line, which you will find in the buildlog.htm file if this does not help.

+1
source

All Articles