At first, I compiled the following code with g++ (actually 'fltk-config --compile') and the executable works fine on Linux. But when I try to compile the code with 'mingw32' on Linux targeting Windows, I run into errors:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
int main(int argc,char**argv){
Fl_Window*Fl_Window_Ptr=new Fl_Window(400*1.618,400,"My second window");
Fl_Window_Ptr->begin();
Fl_Button*Fl_Button_Ptr=new Fl_Button(10,400-40,30*1.618,30,"Hi, I mean, hello world!");
Fl_Window_Ptr->end();
Fl_Window_Ptr->show();
return Fl::run();
}
When I try to compile with 'mingw32' like this:
user@computer:~/Documents$ i586-mingw32msvc-g++ 'fltk-config --cxxflags' 2016_02_06a_1st_Window.cxx 'fltk-config --ldflags' -o 2016_02_06a_1st_Window.exe
This error happens:
i586-mingw32msvc-g++: fltk-config --cxxflags: No such file or directory
i586-mingw32msvc-g++: fltk-config --ldflags: No such file or directory
2016_02_06a_1st_Window.cxx:1:19: error: FL/Fl.H: No such file or directory
2016_02_06a_1st_Window.cxx:2:26: error: FL/Fl_Window.H: No such file or directory
2016_02_06a_1st_Window.cxx:3:26: error: FL/Fl_Button.H: No such file or directory
However, just to mention, the following command is fine and executable works in Linux environment:
user@computer:~/Documents$ fltk-config --compile 2016_02_06a_1st_Window.cxx
I was inspired by this post.