C++ App starting

  1. Sorry for my bad english!!

  2. The Problem:
    Some example:

       If I try to compile HelloWorld, it works without error,
       but I can't start Hello after compiling, i try hello and
       ./hello, but bash: ./hello no rights:
    

=============================================================
linux-viny:/home/ecko/C++ # cpp -o Hello Hello.cpp
linux-viny:/home/ecko/C++ # ./Hello
bash: ./Hello: Keine Berechtigung
linux-viny:/home/ecko/C++ # Hello
bash: Hello: command not found

I use cpp, because g++, gpp make’s many errors!

Can somebody help my by this problem!

llcoolecko

cpp is not the C++ compiler. It is only the C/C++ preprocessor that handles #includes, #define, and that sort of thing. So it’s not surprising that you don’t have an executable program after running cpp.

You have to use g++, or c++ (same thing, just an alias for g++).

g++ -o Hello Hello.cpp

If you get errors, you have to fix them.

OK it works when i use printf().
When I work with cout cin, there are so many errors, consol can’t show all, what can I do?
How I can renew the complet libary-system in /usr/include/c++?

Here is the hello world program in C++.

#include <iostream>

int main()
{
        std::cout << "Hello world" << std::endl;
        return (0);
}

You ought to get a book or tutorial on C++.

I need ne book, i studie mathematic, in university we often programm with c++, on my old pc with winXP it works. I also try it with namespace std and std::,

Maybe you can say me some commands for saving(or show) the complet error, because I can’t see the top, consol is full :); YOu see I’m new(bi) working with suse/linux…

Here’s a good online book on Linux:

http://rute.2038bug.com/index.html.gz