Standard created project, Hello World template opened:

#include <stdio.h> #include <stdlib.h> int main() { printf("Hello world!\n"); return 0; } 

On an account, everything compiles and runs, and here it gives an error:

g ++ -o Pr5 .objs / main.o
g ++: error: .objs / main.o: No such file or directory

g ++: fatal error: no input files

compilation terminated

Process terminated with status 1 (0 minute (s), 0 second (s)) 0 error (s), 0 warning (s) (0 minute (s), 0 second (s))

  • I checked it today from the terminal: compilation happens correctly on both gcc and g ++. Executable files are launched. But how to set up compilation and launch in codeblocks? - Jorje

1 answer 1

Generally speaking, you first need to execute the command

 g++ .../main.cpp -o .objs/main.o 
Is the codeblocks the point at the beginning of the .objs directory name?