Trivial compile question (c++)

Discussion in 'Mac Programming' started by psd, Jun 2, 2009.

  1. psd
    macrumors newbie

    Jun 2, 2009
    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?
  2. Moderator emeritus


    Jul 24, 2002
    Most likely -B is not the correct switch, but I'm not on a Mac (or a machine with g++) installed right now.
  3. macrumors 6502

    Jul 25, 2006

    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.

Share This Page