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 - g++ linking
Summary: g++ linking
Status: RESOLVED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-23 06:54 UTC by Squee3P0
Modified: 2011-11-16 08:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.