Author Topic: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.  (Read 6803 times)

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
I am trying to move a CodeBlocks C++ project to a new computer. Both computers are running Ubuntu Linux 14.04 and both have the gcc compiler installed as /usr/bin/gcc. But on the new one, every attempt to build or compile fails with the message “could not find g++”. It would seem that I need to tell CodeBlocks the path to gcc, but I can find no way to do so. Any help would be much appreciated.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.
« Reply #1 on: June 02, 2015, 08:19:49 am »
Settings -> Compiler -> GCC -> Toolchain executables
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.
« Reply #2 on: June 02, 2015, 11:24:09 am »
"g++" != "gcc" !!!
The c++-compiler ("g++") is not installed automatically on Ubuntu, install it with your favourite packagemanager.
If you never compile c++-sources (just plain c), you can change the linker executable in the toolchain from "g++" to "gcc", but any attempt to link c++-code (with this toolchain) will fail in this case.

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.
« Reply #3 on: June 02, 2015, 05:45:24 pm »
Thanks, Jens, that was exactly the problem. Everything works fine now.

In selecting the wxWidgets libraries to install, I noticed that there are now versions with names ending in i386. I could not, however, find the difference from the earlier libraries. Should these i386 libraries be used on 32 or 64 bit machines -- which are now nearly universal -- instead of the older ones? If so, I need to edit the first of the wxWidgets tutorials to suggest their use. You may recall that I rewrote the versions of these tutorials originally written by the creator of wxSmith and added several more. It is nice to see that they have stood the test of time fairly well and have been read many times.

Clopper

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.
« Reply #4 on: June 02, 2015, 05:59:37 pm »
I should have said wxSmith tutorials, not wxWidgets tutorials.
Clopper

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7791
    • My Best Post
Re: How to tell CodeBlocks the path to the compiler under Ubuntu Linux.
« Reply #5 on: June 02, 2015, 06:08:29 pm »
Thanks, Jens, that was exactly the problem. Everything works fine now.

In selecting the wxWidgets libraries to install, I noticed that there are now versions with names ending in i386. I could not, however, find the difference from the earlier libraries. Should these i386 libraries be used on 32 or 64 bit machines -- which are now nearly universal -- instead of the older ones? If so, I need to edit the first of the wxWidgets tutorials to suggest their use. You may recall that I rewrote the versions of these tutorials originally written by the creator of wxSmith and added several more. It is nice to see that they have stood the test of time fairly well and have been read many times.

Clopper

No.

The i386 are ones for doing builds to 32 bit. If you wanted to build your project on 64 bit targeting 32 bit build it might be correct to use the i386 version.
The  i386 libraries are needed if you download a 32 bit code that can NOT use the normal native libraries. Some of them can use the normal native libraries.

Please read this link https://wiki.debian.org/Multiarch/HOWTO

Tim S.

« Last Edit: June 02, 2015, 06:10:51 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org