| View previous topic :: View next topic |
| Author |
Message |
alloydog LXF regular

Joined: Thu Apr 07, 2005 8:32 pm Posts: 600
|
Posted: Wed Jun 21, 2006 5:03 am Post subject: SOLVED: "Hello World!" - So, what next...? |
|
|
For some reason KDevelop wouldn't compile the "Hello World!" script, so while I get around to fixing it, I installed Xwpe.
I wrote the obligatory "Hello world" script, and in Xwpe, it compiled OK and ran OK.
Now... the last time I tried learning C++, I used a give-away copy of Borland's C++ Builder/TurboC++ version 1 (hence the familiarity with Xwpe) under Windows 98 and NT.
When I complied the script, I got a nice executable file helloworld.exe.
Now I'm using this Linuxy thing, I get helloworld.o and helloworld.e.
I thought the Unix/Linux equivilent of the .exe was a .bin file?
What do I need to get Hello World to print out at the command line, as it would under DOS with the executable?
----edit------
Solved!
| Code: | # helloworld.e
# Hello World!
# |
simple really  |
|
| Back to top |
|
 |
penguintutor

Joined: Mon Jun 05, 2006 2:41 pm Posts: 16 Location: UK
|
Posted: Wed Jun 21, 2006 4:12 pm Post subject: |
|
|
I am not familiar with Xwpe, which appears to have discontinued development, and is lacking in documentation. Here is some generic info that might help.
On unix the file extension is not used to determine whether something is executable or not. Instead the first few bytes of the file are examined to see if it is a program. So the extension doesn't matter. For some formats the normal conventions are used, but for executables normally they are created without any extension so that you just run using the name of the command (without needing to add .exe or .bin on the end).
The .o file is an object file, but I'm not sure about a .e file.
you can see if the operating system recognises the file using:
which may give an idea of what the file is.
Has the program been linked? Without documentation I don't know how that is done, maybe it works with the standard linker?
If it has actually created a binary executable, then you may just need to change it's permissions
| Code: |
chmod u+x [i]filename[/i]
|
_________________ --
PenguinTutor
Penguin Tutor Linux Tutorials and unofficial LPI Certification Practice Exams
twitter.com/PenguinTutor |
|
| Back to top |
|
 |
alloydog LXF regular

Joined: Thu Apr 07, 2005 8:32 pm Posts: 600
|
Posted: Wed Jun 21, 2006 5:28 pm Post subject: |
|
|
just typing helloworld.e at the command line worked fine. The problem was between the chair and the keyboard...
I was expecting helloworld.bin, so was 'confused' a bit by the .e extention.
I didn't know about the file command though.
| Code: | # file helloworld.e
helloworld.e: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped |
Interesting bit: 32-bit LSB executable, Intel 80386 - I thought the 386 was 16-bit? |
|
| Back to top |
|
 |
penguintutor

Joined: Mon Jun 05, 2006 2:41 pm Posts: 16 Location: UK
|
|
| Back to top |
|
 |
GMorgan LXF regular
Joined: Thu Jan 12, 2006 6:58 pm Posts: 684 Location: South Wales, UK
|
Posted: Wed Jun 21, 2006 7:47 pm Post subject: |
|
|
With Kdevelop what do you mean it didn't compile. Do you mean there was no compile option or that it did have a compile option but it didn't work. To get Kdevelop to work properly you need to create a project. Create a simple hello world C++ project and you can then compile via the three buttons above the text editor and at the leftmost corner.
If you are seriously having problems with it post the console output and we can try and fix it. |
|
| Back to top |
|
 |
alloydog LXF regular

Joined: Thu Apr 07, 2005 8:32 pm Posts: 600
|
Posted: Wed Jun 21, 2006 8:57 pm Post subject: |
|
|
| Thanks, I'm checking that out now. |
|
| Back to top |
|
 |
alloydog LXF regular

Joined: Thu Apr 07, 2005 8:32 pm Posts: 600
|
Posted: Thu Jun 22, 2006 8:44 pm Post subject: |
|
|
Kdevelope works fine - once you start a new project...
well which methed should I use?
GEdit + command line compiling => walking
Xwpe => riding a bicycle
KDevelope => fully equipped motorhome, including the kitchen sink...
 |
|
| Back to top |
|
 |
GMorgan LXF regular
Joined: Thu Jan 12, 2006 6:58 pm Posts: 684 Location: South Wales, UK
|
Posted: Fri Jun 23, 2006 10:01 am Post subject: |
|
|
| I like Kdevelop since it can be used for every language under the sun. If in future you decide to learn a scripting language like Python and combine it with C++ (i.e. C++ for the backend and Python for the GUI for quick interface turnover) it can be done using the same tool. Not to mention that its plugin architecture allows you to run things like QT Designer within the project and even import QT UI files directly into a C++ project. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|