This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204112

Summary: g++ linking
Product: cnd Reporter: Squee3P0
Component: -- Other --Assignee: issues@cnd <issues>
Status: RESOLVED INVALID    
Severity: normal CC: abalint21
Priority: P1    
Version: 7.0.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Squee3P0 2011-10-23 06:54:53 UTC
The makefile that Netbeans is producing doesn't work with g++4.6.  Netbeans is putting the link options in the wrong place.  For example, netbeans currently produces:

g++ -lglut main.cpp

which gives the error:  undefined reference to `glutInit'

The correct order is:

g++ main.cpp -lglut

which builds with no errors.  This problem doesn't seem to occur with older versions of g++, and I discovered this error after upgrading to Ubuntu 11.10 and installing the newest versions of g++ and Netbeans.  Unless there is a way to change this behavior which I am unaware of, this is making it impossible for me to use Netbeans with my current system configuration if I want to use anything other than the standard c++ libraries.
Comment 1 soldatov 2011-10-24 06:46:07 UTC
You can use Build > Linker > Libraries > Add Option... > Other Option instead of Build > Linker > Additional Options
Comment 2 Andrew Krasny 2011-10-24 13:25:44 UTC
Hi Squee3P0!

Valery is right that the proper way to configure libraries-related options is to use Linker->Libraries... dialog.

So you just need to use this way.

From the other side this obviously shows that we have a usability problem and need to re-view the approach of specifying compiler flags... I will file a low-priority issue for this. 

So, again, to make it slightly clearer - in current version - Additional Options - are prepended  to the command-line and library-options are appended to it...
Comment 3 Squee3P0 2011-10-25 03:16:01 UTC
Thanks for the help, that worked.  It's just strange that it worked in older versions.