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 257881 - C++ Project uses wrong compiler gcc not g++ as expected
Summary: C++ Project uses wrong compiler gcc not g++ as expected
Status: RESOLVED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-08 03:30 UTC by bht
Modified: 2016-02-08 04:29 UTC (History)
0 users

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 bht 2016-02-08 03:30:42 UTC
Configuration:

On Windows, Tools|Options|C/C++|Build Tools

Base Directory: C:\prog\MinGW\bin
C Compiler: C:\prog\MinGW\bin\gcc.exe
C++ Compiler: C:\prog\MinGW\bin\g++.exe
Make Command: C:\prog\MinGW\msys\1.0\bin\make.exe
Debugger Command: C:\prog\MinGW\bin\gdb.exe

Tools|Options|C/C++|Other
File Type(MIME) : File Extensions
C++ File: C, c++, cc, cpp, cxx, mm
C File: c, cpp, i, m

How to reproduce

Create a new C/C++ Application project.

Select main file type to be created C++.

This generates main.cpp.

Close the project.

Create a new C/C++ Application project project2.

Uncheck "Create main File"

Create a directory src in the project root.

Copy main.cpp from project1 into it.

Ad existing item src/main.cpp
Clean and build

Result:

gcc    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/src/main.o.d" -o build/Debug/MinGW-Windows/src/main.o src/main.cpp

Issue 1) is that the wrong compiler is used for a .cpp file
Issue 2) (for me) is that I cannot change the compiler to match the file.

After exploring options, I cannot see how NetBeans can guess the compiler from the file extension because cpp is used for both C File and C++ File.

So that leaves the question how a project can be reconfigured from using gcc to using g++.
Comment 1 bht 2016-02-08 04:29:27 UTC
Sorry, I failed to notice that the compiler can be configured per file.