FLTK logo

Re: [fltk.general] Re: I just installed FLTK on Linux but I have a compile error

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: I just installed FLTK on Linux but I have a compile error Albrecht Schlosser Oct 27, 2020  
 
On 10/27/20 11:01 AM ken williams wrote:
Thanks Albrecht,  I was able to compile Dr. S first example code with the command:

      g++ -w -Wall -std=c++14 Graph.cpp Window.cpp GUI.cpp Simple_window.cpp test.cpp `fltk-config --ldflags --use-images` -o test

Great, thanks for the feedback.

But when I'm using "fltk-config" like below it doesn't work.

      fltk-config --ldflags --use-images --compile  Graph.cpp Window.cpp GUI.cpp Simple_window.cpp test.cpp -o test

Probably I should change something but I can't see it.
I could use only the g++ command, but it would be nice to understand how to use "fltk-config" also.

You can use fltk-config either to output some flags, for instance with

$ fltk-config --use-images --cxxflags

which outputs the compiler flags you need to compile a program with fltk and fltk_images *or* you can use it to compile a *single* C++ source file but you can't combine both in one command.

Options like '--use-images' are used to modify the output of the related command, i.e. (in this case) add the fltk_images libs and corresponding compiler flags.

Basically this means: if you want to compile more than one file you'd better use a script or a Makefile or write a CMake project file (CMakeLists.txt) and use that to build and compile your app.

Just in case you don't know: the backticks (`...`) in your command above (`fltk-config --ldflags --use-images`) mean: run the given command in a shell and insert the output of this command at this place in the command line.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/15e667f1-f462-c40d-0474-c36edbac8db3%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.