Yeah thanks fltk-config --compile my_file.cxx is spot on. On Thu, Aug 4, 2011 at 10:57 PM, MacArthur, Ian (SELEX GALILEO, UK) <[email protected]> wrote: > >> I have downloaded and installed fltk-1.3.0 and it built successfully. >> Next I accessed http://fltk.org/doc-1.3/fltk.pdf >> and copied the example program at: 4.1 Writing Your First >> FLTK Program >> My attempts to build it give the following errors: >> /tmp/ccyNClof.o: In function `main': >> hello.cxx:(.text+0x38): undefined reference to >> `Fl_Window::Fl_Window(int, int, char const*)' >> hello.cxx:(.text+0xf5): undefined reference to >> `fl_define_FL_SHADOW_LABEL()' >> hello.cxx:(.text+0x111): undefined reference to `Fl_Group::end()' >> hello.cxx:(.text+0x12b): undefined reference to >> `Fl_Window::show(int, char**)' >> hello.cxx:(.text+0x130): undefined reference to `Fl::run()' >> /tmp/ccyNClof.o: In function `Fl_Box::Fl_Box(int, int, int, >> int, char const*)': >> hello.cxx:(.text._ZN6Fl_BoxC1EiiiiPKc[Fl_Box::Fl_Box(int, int, int, >> int, char const*)]+0x30): undefined reference to >> `Fl_Widget::Fl_Widget(int, int, int, int, char const*)' >> hello.cxx:(.text._ZN6Fl_BoxC1EiiiiPKc[Fl_Box::Fl_Box(int, int, int, >> int, char const*)]+0x39): undefined reference to `vtable for Fl_Box' >> collect2: ld returned 1 exit status >> >> What gives? > > > You don't say what host platform you are on, or what toolchain you are > using. > > I'm guessing (from the path spearators) that's it a *nix of some sort, > and the diagnostics look like gcc... > > Anyway, regardless of that, it looks very much like you forgot to tell > the linker to link against the fltk lib (that would be libfltk.a > assuming I guessed your host system correctly!) when linking your > compiled object. > > For a single-file project then just doing > > fltk-config --compile my_file.cxx > > Will probably do it. > For anything more complex, well, Makefiles are good.... > > > SELEX Galileo Ltd > Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 > 3EL > A company registered in England & Wales. Company no. 02426132 > ******************************************************************** > This email and any attachments are confidential to the intended > recipient and may also be privileged. If you are not the intended > recipient please delete it from your system and notify the sender. > You should not copy it or use it for any purpose nor disclose or > distribute its contents to any other person. > ******************************************************************** > > _______________________________________________ > fltk mailing list > [email protected] > http://lists.easysw.com/mailman/listinfo/fltk >
-- Scientific studies prove that scientists are whores just like the rest of us wage slaves. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

