PDA

View Full Version : Trivial compile question (c++)




psd
Jun 2, 2009, 10:12 AM
I bought a c++ book for beginners and am trying to get my first program to compile. All compiling instructions in the book are for visual studio.

The book uses FLTK which I downloaded and installed and wrote a test program to display a hello world dialog. However when I type

g++ -B /usr/local/include/FL/ test.cpp

I get the following error:
test.cpp:1:16: error: Fl.h: No such file or directory
test.cpp:2:20: error: Fl_Box.h: No such file or directory
test.cpp:3:23: error: Fl_Window.h: No such file or directory

What's wrong?



robbieduncan
Jun 2, 2009, 10:32 AM
Most likely -B is not the correct switch, but I'm not on a Mac (or a machine with g++) installed right now.

kpua
Jun 2, 2009, 10:38 AM
Try

g++ -I/usr/local/include/FL/ test.cpp

And of course, make sure that /usr/local/include/FL/ exists and contains the headers you need.