I wrote a simple Hello World Programm and compiled it. There was no Errors or Warnings and all seems to be ok. But when I’m startted it, it ended immediately with no Output and Error Level set <> 0. This Behavior is the same for Programs written with C++, Free Pascal and Nim
Maybe someone can help me with that and tell me what I do wrong?
I had no trouble compiling apps in C, C++, Nim and Vala, both my own and 3rd party. Can you show us your code and the commands you used? Also, what version of Haiku are you on, and is it on 32 or 64 bits?
I compiled it with g++ -o test test.cpp and my Version of Haiku is Beeta 4 x64. Yes, my Brother also sayed it worked for him. It seems a bit wired for me because this is the first Time something like this happens for me.
Oh another Mistake by me. Sorry, I had not so much Sleep this Days and also sort some Stuff at this Moment Sadly this isn’t the Reason for the Reason for this strange Behavior. Otherwise I simply could not compile this I think.
Well, seems as has no one an Idea what it could be. I think then I will reinstall the OS this days and show if this solves this Behavior. If it is done I will post the Results Thank you very much for the Help and wish you a wonderfull Night (or Day)
I hope you won’t do that. If you’re interested in writing computer programs, one of the very most important skills is figuring out what has gone wrong.
Part of that is working with others, if they’re available and willing. To do that, you need to share the exact problem with them. You typed in code that won’t compile, for more than one reason. When we fix it, it works, but it isn’t your program concept that’s wrong - “Hello world” is a time honored algorithm - it’s some detail. Don’t tell them what a “Hello world” program looks like, tell them what your program looks like. Copy and Paste.
Part of that is learning the diagnostics. C++ won’t blow up with an informative error message, you have to explicitly code that. If you are headed for a non-zero exit, you should be able to get an informative diagnostic from the “perror” function.
How do you run your program? If you double-click the generated file in tracker, I don’t think it will show the terminal output at all.
On the other hand, if you run the program from the terminal (by typing ./test after compiling) you should see “Hello World!” as expected.
Also note that the code you’ve posted here is using “ as quotation marks instead of ", which would cause a compilation error, but it sounds like your original program compiles correctly.
This is also just due to missing escaping to prevent the forum from reformatting it. The code itself is fine. I have edited the original message to add the missing escaping but it seems I was a bit late and we now have 5 replies pointing out mistakes that don’t really exist
Sorry for the late reply, I was asleep. Can’t see anything wrong with what you did. Often when this happens it’s because of a little detail that’s hard to notice, or else an external cause. Don’t give up!
I’m so sorry for the Confusion but my Comunication and Explantation Skills are not the best… I excuse me so much for the Lack of Information.
But I finally know what was the Issue. Every Time I was running the Program, at the Commandline I wrote <Programname> instead of ./<Programname>. Oh, this is such a Shame…