0
Good Afternoon, I use linux and I’m learning OpenGL, but when I go compile my code for that mistake:
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
the only code I have is this:
#include <iostream>
#include <GL/glew.h>
and the code I used to compile was this: g++ main.cpp -o main
I already installed the libs:libglm-dev and libglew-dev.
How could I solve.
Use linux Mint 19.3
Thank you very much, sorry I didn’t answer before, I had a few problems here, I didn’t know I needed the main method to compile, thanks
– Codigo de Senior
To compile an executable with the option
-ohave to defineint main(). Only when you build an Object file from an eventual dependency you don’t need.– aviana