So the story begins when I took Global Software Development class in 6th semester. One of the project in this class was to build an application based on C++ with FLTK as GUI Library. My lecturer, Dr. Ward, was using Visual Studio to demonstrate the FLTK stuff. As usual, I worried about how can I survive through this class without using Windows at all. Last semester, I failed to avoid using Windows since I had to code in C# and the best option I had is only Visual Studio.
Nevertheless, before using Netbeans, I did the classic way to build my project : with g++ directly from Terminal. Just type :
g++ -o [exe-name] *.cpp `fltk-config –use-images –ldflags –cxxflags`
Note that I put all the required file in a single folder.
My life changed since my friend, Adinata, had told me that he could build the project under Linux environment with NetBeans. So I tried to follow his steps to get NetBeans ready to compile C++ with FLTK. What you have to do are :
- Make sure you already installed FLTK on your MacOSX before you go any further. I’m not going to tell how to install FLTK on Mac since there are a lot of tutorial out there.
- Open your NetBeans, and create a new C++ project.
- Right click on your C++ project, then click Properties.
- Go to Build >> C++ compiler tab, add the following text in Additional Options : `/usr/local/bin/fltk-config –cxxflags`
- Now go to Linker tab, click on Libraries then a window will appear.
- Click Add Options, choose Other Option and add the following text to the box : `/usr/local/bin/fltk-config –use-images –ldflags`
- We’re done ! Click OK to get back to the project and try to build your project.