0

I am new to C++ (since March) and am currently learning about GUI's. I have a very simple code that runs without error, but no window or GUI is displayed.

Here is my code:

#include <Fl.H>
#include <Fl_Window.H>

int main(int argc, char ** argv){

Fl_Window win(400, 400);
win.show();

return(Fl::run());
}

There was another individual on here that had the same problem with the same code, but he was using Cygwin (FLTK applications in Cygwin: GUI doesn't show?). The answer given to his question was the following:

If fltk-config --cxxflags and fltk-config --ldflags do not output -mno-cygwin, then your FLTK was compiled to work with Cygwin's X Window System - something you probably want to avoid. Add -mno-cygwin to your Makefile and your FLTK application should work.

I always liked MinGW+MSYS more.

To be honest, I don't understand what all that means, let alone applying it to my IDE and compiler. I'm guessing he was talking about using the command prompt to check something... but that is as far as I got.

I am running Dev-C++ 5.6.3 with MinGW with the 'TDM-GCC 4.8.1 32-bit Debug' option from the pull-down menu. In order to build GUIs in Dev-C++, I downloaded the Fast Light Toolkit (FLTK) 1.1.7 from devpaks.org community devpaks. I also had to go into the 'Compiler Options' and, under the 'Directories' tab, add the directory paths for those FLTK files under 'C++ Includes' tab, 'C Includes' tab, 'Libraries' tab, and 'Binaries' tab. Apart from all this, I am running all of this on a Windows 8.1 (64-bit) operating system.

Any help would be greatly appreciated!

Community
  • 1
  • 1
  • Please provide the error you are getting when trying to build your application. The comment you quoted above was mine. That case is different from yours I believe as that person used Cygwin environment. You should build newer FLTK, 1.3.x . 1.1.7 is just too old. I will download Dev-C++ and try to reproduce the error. – DejanLekic May 30 '14 at 11:21
  • Dejan, please read through my post again. I mentioned at the top that I was not getting any error message whatsoever. Maybe I should have been more specific in saying that the program compiled without error. Also, I know that the other person used Cygwin environment. – MechEInventor Jun 02 '14 at 16:13
  • OK, fair enough. Try to put some widget in the window and see whether it shows up or not... I can't help you much really until I get DevC++ and 1.1.7 devpak and try to reproduce the problem. You should perhaps try to build FLTK yourself, and setup a simple C++ project in DevC++. – DejanLekic Jun 02 '14 at 17:06
  • Are you using the "Orwell Dev-C++" or the BloodShed's (old) one?? – DejanLekic Jun 03 '14 at 07:55

1 Answers1

0

OK, I have downloaded the Orwell Dev-C++ 5.6.3 with bundled MinGW's GCC 4.8.1. Then I downloaded FLTK 1.3.0 DevPak from http://DevPaks.org and it was straightforward to reproduce the problem. My first guess is that the libraries inside the DevPak file (they originate from https://code.google.com/p/fltkwinbin ) are not good for the much more up-to-date environment Dev-C++ 5.6.3 is using.

It would be the best to build FLTK inside Dev-C++ 5.6.3, and then use those libraries in your projects. If I find some time, I will do this, and perhaps build a more up-to-date DevPak... Stay tuned.

DejanLekic
  • 18,787
  • 4
  • 46
  • 77