View previous topic :: View next topic |
Author |
Message |
PhantomFav
Joined: 13 Jun 2011 Posts: 16
|
Posted: Mon Sep 02, 2013 2:27 pm Post subject: Error g++2 when compiling |
|
|
Hi, after installing a new OS (xubuntu 13.04) i have encountered a problem during compilation, when I press the compile button in the GUI an error pop up saying:
Code: | Error:
g++2
/media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: 1: /media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: c++: not found
g++2
/media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: 1: /media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: c++: not found
while executing
"exec $env(BLUESPECDIR)/bin/bsenv c++_family"
(procedure "customize_custom_command" line 8)
invoked from within
"customize_custom_command $exe"
(procedure "commands::link_via_bsc" line 18)
invoked from within
"commands::link_via_bsc"
(procedure "link_get_cmd" line 9)
invoked from within
"link_get_cmd"
(procedure "commands::comp_and_link" line 3)
invoked from within
"commands::comp_and_link"
(procedure "menu_actions::build_comp_and_link" line 2)
invoked from within
"menu_actions::build_comp_and_link"
invoked from within
".tb.compilelink invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke]"
(procedure "tk::ButtonUp" line 22)
invoked from within
"tk::ButtonUp .tb.compilelink"
(command bound to event) |
I can't figure out how to get rid of this error, can you help me?
EDIT: the problem show up every time the compiler try to create the out executable, the .ba and .bo file are normaly created |
|
Back to top |
|
 |
quark Site Admin
Joined: 02 Nov 2007 Posts: 496
|
Posted: Mon Sep 02, 2013 3:19 pm Post subject: Re: Error g++2 when compiling |
|
|
Have a look at the script "bsenv" in the Bluespec installation. This script is used by BSC to determine the C++ compiler and flags to use when compiling C++ files on your system. The first thing that BSC does is to try to determine which version of C++ you have, so that I can decide which pre-compiled shared object files to use (since earlier versions of GCC are not compatible with later ones, for instance). So try this command:
Code: | /media/sda3/Bluespec-2012.01.A/lib/bin/bsenv c++_family
|
I suspect that this will give you same error that you saw about the command "c++" not being found. If you look in the script, you'll see that it first consults the environment variable "CXX" to see if your environment has specified the command for the C++ compiler; if not, then it defaults to "c++".
So the first question is whether you have a C++ compiler installed on your system. For instance, does GCC come installed standard on xubuntu 13.04 or do you need to install it?
If GCC or another C++ compiler is installed, then you should either make "/usr/bin/c++" be a link to it or you should set CXX in your environment to be the command to run. |
|
Back to top |
|
 |
PhantomFav
Joined: 13 Jun 2011 Posts: 16
|
Posted: Mon Sep 02, 2013 3:52 pm Post subject: |
|
|
thanks for your help, you were right, so as you say i have checked for gcc, and i have found it. So i've created a symbolic link:
Code: | sudo ln -s /usr/bin/gcc /usr/bin/c++ |
but when the compiler do:
Code: | + bsc -e mkTb -sim -o ./out -simdir . -p .:%/Prelude:%/Libraries -keep-fires |
another error come out:
Code: | c++: error trying to exec 'cc1plus': execvp: No such file or directory |
what is the problem?
Last edited by PhantomFav on Mon Sep 02, 2013 3:59 pm; edited 1 time in total |
|
Back to top |
|
 |
quark Site Admin
Joined: 02 Nov 2007 Posts: 496
|
Posted: Mon Sep 02, 2013 3:58 pm Post subject: |
|
|
I did some googling around and it looks like, while you have gcc installed, maybe you don't have g++ installed -- which could explain why c++ was not linked to it. I'd suggest removing the link to "gcc" and trying to install the "g++" package. Hopefully that will also create a link for "c++" (to point to "g++" and not to "gcc"). |
|
Back to top |
|
 |
PhantomFav
Joined: 13 Jun 2011 Posts: 16
|
Posted: Mon Sep 02, 2013 4:13 pm Post subject: |
|
|
oh thanks a lot! you are my savior, this is the solution for the specific problem:
Code: | sudo apt-get update
sudo apt-get install build-essential |
|
|
Back to top |
|
 |
|