Gcc fails to recognize `-I../path`

丶灬走出姿态 提交于 2019-12-24 02:52:33

问题


I have a problem with linking and gcc, probably resulting from a stupid mistake on my side. Drawing from this post Header files linked to from header file not found, I tried the -I option to inlcude header files, but gcc just does not seem to recognize the parameter.

~/Documents/projects/opencl/NVIDIA_GPU_Computing_SDK/src_l$ gcc opencl_hello_world.c –I../OpenCL/common/inc/CL/ –L/usr/local/cuda/lib –lOpenCL
gcc: –I../OpenCL/common/inc/CL/: No such file or directory
gcc: –L/usr/local/cuda/lib: No such file or directory
gcc: –lOpenCL: No such file or directory
In file included from opencl_hello_world.c:6:
../OpenCL/common/inc/CL/opencl.h:42:40: error: ../OpenCL/common/inc/CL/cl.h: No such file or directory
../OpenCL/common/inc/CL/opencl.h:43:43: error: ../OpenCL/common/inc/CL/cl_gl.h: No such file or directory
../OpenCL/common/inc/CL/opencl.h:44:47: error: ../OpenCL/common/inc/CL/cl_gl_ext.h: No such file or directory
../OpenCL/common/inc/CL/opencl.h:45:44: error: ../OpenCL/common/inc/CL/cl_ext.h: No such file or directory

When I input the command cd ../OpenCL/common/inc/CL/ it brings me to the right folder with the right header files in it.

What do I do wrong?


回答1:


Check if - in -I, -L, -l is not in some other language.

It seems like some unicode symbol, not ascii.

That's why they are not recognized as gcc options but source files.



来源:https://stackoverflow.com/questions/3668680/gcc-fails-to-recognize-i-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!