|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Linux problems
Ive just installed SuSE 8.1 personal and im a bit miffed because the personal edition doesn't have Apache or PHP in the distro You have to purchase the professional version here in england to get Apache and PHP included
Quite sad really... but apart from that i get most everything else Anyway my main question is? I created a simple helloworld.c and compiled it with g++ Everything compiled but when i tried to execute helloworld i got a message "cant execute binary" The binary file was in a sub dir of /home/c++ and I was root chmod a+x helloworld command $ ./helloworld error "cant execute binary" Anyone know?
__________________
100 trillion calculations per nanosecond Last edited by Marky_Mark : December 18th, 2002 at 11:06 PM. |
|
#2
|
|||
|
|||
|
/home is meant for user folders,don't use it for C++ programs.
Further I have no clue why it doesn't work,can you show us the code? |
|
#3
|
|||
|
|||
|
Quote:
Huh? You can use your home folder to run whatever the heck you want. Especially if you're coding and testing some programs. Try using gcc -o helloworld helloworld.c instead of g++. Are you coding c++ or c? Also, just because your distro didn't come with apache and php doesn't mean you can't get it. Go to their websites and download either a package or the source and you'll be good to go from there. |
|
#4
|
|||
|
|||
|
Quote:
No one said that you can't,but it's better to put that somewhere else,because it looks like there is a user named c++ then. |
|
#5
|
|||
|
|||
|
The helloworld code is fine cause it compiles ok using g++ -c helloworld.c -o helloworld
And i agree with damonbrinkley you should be able to compile under /home but not sure if you can run binaries under /home Just configured my modem under Linux so i will be downloading Apache and PHP I would like to know if i can run binaries from /home/c++ I think it might be file permissions causing the errors |
|
#6
|
||||
|
||||
|
It should not be a file permissions problem. I have a temp directory in my own home directory that I compile C and C++ programs with quite often for testing.
As long as you have permissions to execute in that directory, and the file is set as an executable then that should not matter. On a side note, if you are coding in C, use gcc. No point in using a C++ compiler to compile a C program. (little bit of overkill and still going to be slow) |
|
#7
|
|||
|
|||
|
Good point about gcc and g++ however i still cant execute the binary
chmod 777 hello bash: ./hello "cannot execute binary file" I dont know why Last edited by Marky_Mark : December 20th, 2002 at 12:29 AM. |
|
#8
|
||||
|
||||
|
Quote:
May be a typo, but thought I'd check, if you do g++ -c, then that only complies it, and doesn't link the program. You need to link it before it will run. Take the -c out and it should work. |
|
#9
|
|||
|
|||
|
I thought the compile option done the linking aswell like in cygwin
Its ok now my helloworld runs fine, in future i will just emit the -c option Thanks Last edited by Marky_Mark : December 20th, 2002 at 12:27 AM. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Linux problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|