What is the correct way to work with another C ++ compiler in a CDT project?

I am using Eclipse CDT Mars.2 (and Neon RC) on Linux. My default distribution is the C ++ compiler GCC 5.3.1, but for some of my work I use GCC 4.9.3. I would like everything related to my project to use GCC 4.9.3: Tool discovery, C ++ standard library, included file paths, indexer, preprocessing - all this.

What is the right way to do this? It seems that Eclipse has quite Byzantine configurations “providers” and “bindings”, and I don’t want to make settings that I can’t cancel later ...

Note:  I tried replacing ${COMMAND}with /usr/bin/g++-4.9in some settings the preprocessor provider, etc., and this led to the detection of related files related to 4.9.3, but my indexer did not like it, and all std :: material appeared red and unresolved. Then I tried to find where I installed the compiler version used for indexing, but I could not find it.

+4
source share
1 answer

, , " Make" "Mangaged Make". Make , Make . Managed Make , CDT Makefile .

make , . , , , , .

, ${COMMAND} . ( ), , , Makefile.

${COMMAND}:

  • ( )
  • C/++ General → Preprocessor Include Paths, .. .
  • "".
  • CDT GCC
  • ${COMMAND} Command, : g++.

, :

edit command

, . /usr/bin/g++, 5.3 /usr/bin/g++-4.7, 4.7.

g++

g ++ 5

g++ 4

g ++ 4

, g++ Makefile . C/++ Build Environment CXX . CXX (Project Properties → C/++ Build → Environment) (Preferences → C/++ → Build → Environment).

${COMMAND} ${CXX}.

, , :

environment

make

Managed Make, . Preprocessor Include Paths, Macros .., .

, , , , . → C/++ Build → , :

  • GCC ++ → g++
  • GCC C → gcc
  • GCC ++ Linker → g++

, :

mananged make screenshot

+2

All Articles