On 13.12.2010, at 06:12, s wrote:
> I have a whack-a-mole type game using FLTK and I have compiled/run the game 
> on a linux server. I need to compile/run it on a sun machine (putty) and 
> cannot figure out how to do so. I use the following on linux:
>
>
> Compiling the Code:
> ==================
> g++ -c Graph.cpp `fltk-config --cflags --ldflags`
> g++ -c GUI.cpp `fltk-config --cflags --ldflags`
> g++ -c Window.cpp `fltk-config --cflags --ldflags`
> g++ -c Simple_window.cpp `fltk-config --cflags --ldflags`
> g++ -c Scoreboard.cpp `fltk-config --cflags --ldflags`
> g++ -c Main_window.cpp `fltk-config --cflags --ldflags`
> g++ -c moles.cpp `fltk-config --cflags --ldflags`
> g++ game.cpp -o game GUI.o Graph.o moles.o Window.o Main_window.o 
> Simple_window.o Scoreboard.o `fltk-config --cflags --ldflags` -lfltk_images
>
> Running the Code:
> ================
> ./game
>
> This works on linux. Please help.

Although this may work, there are some "wrong" assumptions in your
commands (please read what Matt and Ian wrote as well).

1) replace g++ with `fltk-config --cxx`
2) replace --cflags with --cxxflags
3) optional: remove --ldflags from the compile-only lines
4) use -lfltk-images before `fltk-config...` in the last
    (linker) line, or better use --use-images

This all results in:

`fltk-config --cxx` -c Graph.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c GUI.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c Window.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c Simple_window.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c Scoreboard.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c Main_window.cpp `fltk-config --cxxflags`
`fltk-config --cxx` -c moles.cpp `fltk-config --cxxflags`
`fltk-config --cxx` game.cpp -o game *.o `fltk-config --use-images 
--cxxflags --ldflags`

Note that I used "*.o" to shorten the line only; YMMV.

This should also work on linux, and will probably give you better
results on the Sun, but as Ian said: using a Makefile would probably
be better.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to