문제

Happy New Year Everybody,

I am struggling with a rather stupid gcc include problem. I tried to change my working relative include paths (using -I) to absolute paths, so that I could move the source files and it would still compile.

Relative path (working):

-I../../../NVIDIA_GPU_Computing_SDK/OpenCL/common/inc -lOpenCL

Absolute path (not working):

-I~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc -lOpenCL

So how do you inlcude header files with absolute paths from the home directory?

Thanks

[update]

I tried the $HOME idea with -I$HOME/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc but the output of the make file says:

gccIOME/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc-lOpenCL -O3 -fno-strict-aliasing -fopenmp -std=c99 -lm -D_GNU_SOURCE -Wall -pedantic foo.c foo.c:14: fatal error: CL/cl.h: No such file or directory compilation terminated.

Does it make a difference that I use a make file for these parameters?

도움이 되었습니까?

해결책

Specify the full path or $HOME instead of using ~ for the home directory

다른 팁

Try using $HOME instead of ~.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top