Hi,
gcc, like all c++ compilers ; needs to know more about the (non standard)
libraries you want to use with your program.
So you must indicate that you want to use and where it is.
For this to work, you must after compiling fltk, make sure that you installed
it.
So you must run (only once) the following command at the root of the fltk
distrib:
make install (if you are root)
or
sudo make install (will ask you to login give the root password)
This will install fltk in your system.
Then, for compiling any program that is not included in the test subdirectory,
do this:
fltk-config --compile my_hello_prog.cxx
where my_yellow_prog.cxx is your c++ source code.
If you wish to debug it with gdb (for instance) do this:
fltk-config -g --compile my_hello_prog.cxx
Fabien
> Hello,
> I am self taught and rather unfamilair with the g++/GCC compiler toolchain.
> That said:
>
>
> I ran make on the 1.3 version and it seemed to do its job without any
> problems. However, when I try to compile the helloworld program:
>
> #include <FL/Fl.H>
> #include <FL/Fl_Window.H>
> #include <FL/Fl_Box.H>
>
> int main(int argc, char **argv) {
> Fl_Window *window = new Fl_Window(300,180);
> Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
> box->box(FL_UP_BOX);
> box->labelsize(36);
> box->labelfont(FL_BOLD+FL_ITALIC);
> box->labeltype(FL_SHADOW_LABEL);
> window->end();
> window->show(argc, argv);
> return Fl::run();
> }
>
> using the command:
> g++ -o tester tutorial.cxx
>
> I get the following errors:
> tutorial.cxx:1:19: error: FL/Fl.H: No such file or directory
> tutorial.cxx:2:26: error: FL/Fl_Window.H: No such file or directory
> tutorial.cxx:3:23: error: FL/Fl_Box.H: No such file or directory
> tutorial.cxx: In function âint main(int, char**)â:
> tutorial.cxx:6: error: âFl_Windowâ was not declared in this scope
> tutorial.cxx:6: error: âwindowâ was not declared in this scope
> tutorial.cxx:6: error: expected type-specifier before âFl_Windowâ
> tutorial.cxx:6: error: expected `;' before âFl_Windowâ
> tutorial.cxx:7: error: âFl_Boxâ was not declared in this scope
> tutorial.cxx:7: error: âboxâ was not declared in this scope
> tutorial.cxx:7: error: expected type-specifier before âFl_Boxâ
> tutorial.cxx:7: error: expected `;' before âFl_Boxâ
> tutorial.cxx:8: error: âFL_UP_BOXâ was not declared in this scope
> tutorial.cxx:10: error: âFL_BOLDâ was not declared in this scope
> tutorial.cxx:10: error: âFL_ITALICâ was not declared in this scope
> tutorial.cxx:11: error: âFL_SHADOW_LABELâ was not declared in this scope
> tutorial.cxx:14: error: âFlâ has not been declared
>
> What should I do to get it working?
> Thanks...
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk