Компилятор GNU GCC не компилируется, когда путь содержит пробелы (C ++)

1028
John Boe

Я установил code :: blocks и GNU GCC + SDK Stream (Open GL) в точности так, как описано в уроке «Игра с OpenCL: размытие по Гауссу» Лефтериса. Почему я не могу скомпилировать, используя пробелы в пути к библиотеке, когда автор Лефтерис мог? Путь потока SDK неизменен:

C:\Program Files\AMD APP 

, Когда я пытаюсь GCC видит это как

"Files\AMD" 

... и генерирует ошибки. Любое решение для этого? Я использую Windows XP.

-2

2 ответа на вопрос

1
Tommy

Try putting quotes around the segments with spaces in the GCC CMD line argument, e.g.,

C:\"Program Files"\"AMD APP"\... 

or

"C:\Program Files\AMD APP\..." 
0
John Boe

No quotes help in any form. This is nothing to do with spaces but with length of the file name. Compiler sees it as old MS-DOS in form of 8 characters as for name of file and 3 characters for extension. Any longer file name/folder must be renamed.

Solution: 1. go to the directory you need to get the real name of Create link to command.com; working path filed stays empty 2. submit 3. run command.com in the folder 4. in command prompt type dir 5. select the text and copy it to clipboard by enter 6. edit the text as needed and paste it to the Code::Block Here are examples of my paths:

C:\PROGRA~1\AMDAPP~1\lib\x86\OpenCL.lib 

(shortcut for C:\Program Files\AMD APP\lib\x86\OpenCL.lib )

W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll 

(shortcut for W:\___NEW_PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll)

So now it works and errors disappear. I hope this helps to others.

Похожие вопросы