views:

93

answers:

1

Hello. I am new to C++. Before, when working with Java, I could make an executable as either a jar or exe file. Is it is possible in C++ for any other format? I need an format that works on Linux. I am using Eclipse as development IDE - is there any built in way to export as an executable file?

+2  A: 

Linux uses ELF format for executables. Just setup Eclipse CDT IDE and creator will ask you if you want executable, static or shared library. Although it can be directly set in Project Properties (C/C++ Settings -> Build -> Build Artifacts)

On Java you are running class files, which can be packed into jar archives, because class is an executable format recognized by Java Virtual Machine. Thus one needs JVM to run jar or class files. But JVM can be packed together with your jar/class files into single executable, native to the certain system. That's why you have an option to build executable in Java. C++ doesn't use virtual machine, so usually there's no need for another format than system native executable.

Also note that it may be a little bit tricky if you want Linux executable format and you are working on Windows.

doc