Skip to main content

Thread: Could use some help with Geany


i'm trying super basic hello world code in c++. typed in how walk-through showed me, error every time click build button.

g++ -wall -o "untitled" "untitled.cmm" (in directory: /home/hunter)
compilation failed.
untitled.cmm: file not recognized: file format not recognized
collect2: ld returned 1 exit status

have no idea **** i'm doing

code:
#include <iostream>  using namespace std;  int main()    {     cout << "hello world!";     getchar();     return 0; }
is have typed in.

first, rename file untitled.cpp.

secondly, use of getchar() incorrect. need #include cstdio , declare first.
code:
#include <iostream>  #include <cstdio>    using namespace std;    int main()  {          char c;          cout << "hello world!";          c=getchar();          return 0;  }


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Could use some help with Geany


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support