help beginner

May 21, 2013 at 12:28pm
i have some cpp and hpp that download from a book. However, i do not know how can make it link and work. i think it may be the problem of directory. can anyone help me.

May 21, 2013 at 12:49pm
Considering the information that you did (not) give, I would do:
g++ -Wall -o foo *.cpp
May 21, 2013 at 12:50pm
Troll?
May 21, 2013 at 1:08pm
no i am a beginner.
the code is #include<Random1.h>
if i change <Random1.h> to "Random1.h", it works.
the book say this is directory problem. how can i fix it instead of change the code to "Random1.h".
thanks.
May 21, 2013 at 1:16pm
You have to tell the compiler (preprocessor actually) to add current directory to the search path for the includes.
May 21, 2013 at 1:19pm
can you help me how to tell compiler to add current directory.
i use windows 7 and vc 2010.
thans.
May 21, 2013 at 1:24pm
No, but I can tell that VC 2010 has a manual.
May 21, 2013 at 1:51pm
thanks, i have find the place for the include directory and it works. however there is another problem. it is initially for the boost library. now i change it to my <Random1.h> file, so how about the boost.
Topic archived. No new replies allowed.