User forums > Help

Why I got Error - "No such file or directory"?

(1/4) > >>

wever:
I am trying to configure project according this tutorial:
http://blog.refu.co/?p=663

I have set linking to
C:\Program Files\AMD APP\lib\x86\OpenCL.lib
and
W:\___NEW PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll
libraries
Compiler Search folder to:
C:\Program Files\AMD APP\include\CL
and Search directories Linker folder to
C:\Program Files\AMD APP\lib\x86\

Now I run this code:


--- Code: ---#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

--- End code ---

And I got these errors:

||=== Build: Debug in Gaussian_with_OpenCL (compiler: GNU GCC Compiler) ===|
 Files\AMD||No such file or directory|
 Files\AMD||No such file or directory|
 PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll||No such file or directory|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

Why the path is incorrect and does not correspond with the data saved in form?

Code::Blocks v13.12 running on Windows XP

Edit:

--- Code: ---After I added quotes I have these errors:
mingw32-g++.exe -L"C:\Program Files\AMD APP\lib\x86\" -o bin\Debug\Gaussian_with_OpenCL.exe obj\Debug\main.o  -lOpenCL  "C:\Program Files\AMD APP\lib\x86\OpenCL.lib" -lrefu.dll "C:\Program Files\AMD APP\lib\x86\OpenCL.lib" "W:\___NEW PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll"
mingw32-g++.exe: error: Files\AMD: No such file or directory
mingw32-g++.exe: error: APP\lib\x86\OpenCL.lib -lrefu.dll C:\Program: Invalid argument
mingw32-g++.exe: error: Files\AMD: No such file or directory
mingw32-g++.exe: error: APP\lib\x86\OpenCL.lib W:\___NEW: Invalid argument
mingw32-g++.exe: error: PROJECTS\GaussianBlur\Gaussian_with_OpenCL\refu.dll: No such file or directory
--- End code ---

Vuki:
Because these paths have spaces, so the compiler divides them into separate options.
Try putting these paths in quotation marks in project options.
Also, PROGRA~1 may be used instead of Program Files.
In general, avoid using paths with spaces.

wever:
No, quotes did not help, at any form.
This is nothing to do with spaces.
This is to do with real file name as seen by MS-DOS (8 characters for file name and 3 characters for extenssion) or command.com interpreter.

Solution:
this is for case that somebody will find this post searching net
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.

wever:
I have linked dll library:
W:\___NEW~1\GAUSSI~1\GAUSSI~2\refu.dll
but when I try to build I got error:

--- Code: ---||=== Build: Debug in Gaussian_with_OpenCL (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lrefu.dll|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

--- End code ---

The file really exists:

--- Code: ---W:\___NEW~1\GAUSSI~1\GAUSSI~2>dir

28.08.2014  20:41    <DIR>          .
28.08.2014  20:41    <DIR>          ..
28.08.2014  12:55    <DIR>          bin
28.08.2014  16:12             1 707 Gaussian_with_OpenCL.cbp
28.08.2014  16:56               224 Gaussian_with_OpenCL.depend
28.08.2014  20:25               139 Gaussian_with_OpenCL.layout
24.11.2013  20:14               117 main.cpp
28.08.2014  12:55    <DIR>          obj
31.08.2012  14:47           216 347 refu.dll

--- End code ---

Why the compiler does not see complete path?

oBFusCATed:
You've not posted the full build so we can hardly help you!

See here for details: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Insisting on using 8.3 file names will cause problems in the long run for sure...

Navigation

[0] Message Index

[#] Next page

Go to full version