本文介绍了Gcc无法识别`-I ../ path`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个链接和gcc的问题,可能是由于我身边一个愚蠢的错误。从这篇文章中绘制,我尝试了 -I 选项来包含头文件,但gcc似乎没有认出这个参数。

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

当我输入命令 cd ../ OpenCL / common / inc / CL / 它将我带到正确的hea文件夹der文件。

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

我做错了什么?

推荐答案

检查 -I -L 中的 - -l 不是其他语言。

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

它好像是一些unicode符号,而不是ascii。

It seems like some unicode symbol, not ascii.

这就是为什么它们不被识别为 gcc 选项,但是源文件。

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

这篇关于Gcc无法识别`-I ../ path`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:53