Hi fellas,
it seems simple but i can not do it. im started to work on nvidia cuda with visual studio. however when i try to include a header from a far directory, it fails to build.
for example i want to use "cutil.h" in my program and this header file is in this directory: "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc"
im adding this path into Project properties -> Configuration Properties -> Linker -> General -> Additional Library Directories it can not build. it says "Cannot open include file: 'cutil.h': No such file or directory"
How can i include it? What did i miss?
Thanks.
include a header file from directory
Page 1 of 15 Replies - 3263 Views - Last Post: 10 October 2010 - 10:46 AM
Replies To: include a header file from directory
#2
Re: include a header file from directory
Posted 10 October 2010 - 10:06 AM
Quote
m adding this path into Project properties -> Configuration Properties -> Linker -> General -> Additional Library Directories
You are specifying the header search path. This has nothing to do with the linker and lib search path. You want to specify additional include directories. It's under the C/C++ options. There should be a place somewhere to add additional header search paths.
#3
Re: include a header file from directory
Posted 10 October 2010 - 10:10 AM
Either put it in your compilers include directory
or put it where your main projects .cpp file is
and
#include <cutil.h>
or
#include "cutil.h"
respectively.
or put it where your main projects .cpp file is
and
#include <cutil.h>
or
#include "cutil.h"
respectively.
This post has been edited by snoopy11: 10 October 2010 - 10:11 AM
#4
Re: include a header file from directory
Posted 10 October 2010 - 10:18 AM
Oler1s, on 10 October 2010 - 09:06 AM, said:
Quote
m adding this path into Project properties -> Configuration Properties -> Linker -> General -> Additional Library Directories
You are specifying the header search path. This has nothing to do with the linker and lib search path. You want to specify additional include directories. It's under the C/C++ options. There should be a place somewhere to add additional header search paths.
i tried tools->options->project and solutions->VC++ directories and add include directories this the path which i mentioned. however, nothing changed:/
i think it has a simple solution but i can not find it.
snoopy11, on 10 October 2010 - 09:10 AM, said:
Either put it in your compilers include directory
or put it where your main projects .cpp file is
and
#include <cutil.h>
or
#include "cutil.h"
respectively.
or put it where your main projects .cpp file is
and
#include <cutil.h>
or
#include "cutil.h"
respectively.
it has a lot of dependicies with other files. i can not put it near the source file.
how can do other way? can you explain?
#5
Re: include a header file from directory
Posted 10 October 2010 - 10:32 AM
As I said you can copy paste it into your compilers include directory
if you are using MSVC its Program Files->Microsoft Visual Studio->VC
if it has dependecies with other header files then you can copy them there too.
if you are using MSVC its Program Files->Microsoft Visual Studio->VC
if it has dependecies with other header files then you can copy them there too.
#6
Re: include a header file from directory
Posted 10 October 2010 - 10:46 AM
snoopy11, on 10 October 2010 - 09:32 AM, said:
As I said you can copy paste it into your compilers include directory
if you are using MSVC its Program Files->Microsoft Visual Studio->VC
if it has dependecies with other header files then you can copy them there too.
if you are using MSVC its Program Files->Microsoft Visual Studio->VC
if it has dependecies with other header files then you can copy them there too.
is there an elegant solution. no offense. your solution is not bad however i can not do it all the time.
i think there is lib file and header files. including lib files make us use headers. am i correct?
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|