Build FLTK C++ with NetBeans on MacOSX

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 :

  1. 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.
  2. Open your NetBeans, and create a new C++ project.
  3. Right click on your C++ project, then click Properties.
  4. Go to Build >> C++ compiler tab, add the following text in Additional Options :     `/usr/local/bin/fltk-config –cxxflags`
  5. Now go to Linker tab, click on Libraries then a window will appear.
  6. Click Add Options, choose Other Option and add the following text to the box : `/usr/local/bin/fltk-config –use-images –ldflags`
  7. We’re done ! Click OK to get back to the project and try to build your project.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s