I have a problem with linking and\or 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:
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).
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.
I than tried "sudo add-apt-repository ppa:ferramroberto/java", which if I remember correctly did not work.
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.
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!
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).
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
sudo apt-get install eclipse
. Then use the Eclipse Software Installer to install the CDT.