Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 14176  / 2 Years ago, thu, june 2, 2022, 5:50:03

I have a problem with linking andor running a simple program in my eclipse. I'll try to first give a full description of the setup I'm using, to help identify the problem. Please notice that this is my first experience with installing and setting up an operating system which is not Windows, though I got to use some version of Ubuntu on my campus.



I created a new Ubuntu virtual machine yesterday on VMware Player. I provided it with the path to an image file of the installation disc of Ubuntu 11.10 for 32 bit systems named "ubuntu-11.10-desktop-i386.iso".



The machine than went on to install Ubuntu 11.10 on itself. Afterwards I logged in (using the Unity-2D option) and did some basic setup:




  1. First, I chose to install all the updates offered to me automatically by Ubuntu (around 400). I let the thing download and install in the background, and when it finished, I restarted (as I was requested).


  2. Second, I ran "sudo apt-get install python-software-properties". I can't remember why, but it was probably some part of a guide of how to install Java on Ubuntu.


  3. I than tried "sudo add-apt-repository ppa:ferramroberto/java", which if I remember correctly did not work.


  4. The bash history than shows a run of "sudo apt-get update", which I remember seemed successful in installing some stuff. Again, the line originated in some tutorial or guide to installing Java on Ubuntu.


  5. I than went on to install the Java version 6 JRE using "sudo apt-get install sun-java6-jdk sun-java6-plugin". This worked and made me happy (as a latter "java -version" showed that Java was installed) - finally, the correct command was found!


  6. Than I unpacked the file "eclipse-cpp-indigo-SR2-incubation-linux-gtk.tar.gz" into my /usr/Apps folder, and than moved it to the /opt/ folder (I don't remember where it's located).


  7. Finally, I installed g++ using the command "apt-get install g++". Things looked good.




I than created a simple HelloWorld program - I created a source file named "try1.cpp" and wrote in this code:



#include <cstdio>
int main(int argc, char* argv[])
{
printf("Hello World1!/n");
return 0;
}


When I build the project using right click on the project and ->'Build Project', I get the following input:



**** Build of configuration Debug for project OS.Ex4 ****

make all
Building file: ../try1.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"try1.d" -MT"try1.d" -o "try1.o" "../try1.cpp"
Finished building: ../try1.cpp

Building target: OS.Ex4
Invoking: GCC C++ Linker
g++ -o "OS.Ex4" ./try1.o
Finished building target: OS.Ex4

**** Build Finished ****


I can see that the try.o object is created in the 'debug' folder of the project, and I can also see that no binary file is created - both by the build log and the lack of it in the 'debug' folder.



That is why it is not surprising that when I try to run my project I get the next error message: "Launch failed. Binary not found."



So, what am I doing wrong? I have the g++ compiler, and it's compiling the code into object files correctly, so why no linking into a binary file is done? I have an intact main function...



I'll appreciate your help with solving this problem.



Thanks,

Shay


More From » 11.10

 Answers
2

As cqcallaw recommended in his second comment, installing using sudo apt-get install eclipse instead of manually downloading and unpacking the compressed package, solved the weird behaviour eclipse exhibited.


[#38267] Saturday, June 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enefiama

Total Points: 43
Total Questions: 125
Total Answers: 102

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
;