I just downloaded the GCC compile for C/C++. After compiling with the command gcc main.c -c -lGL -lGLU -lglut I get a permission error which can be fixed by changing the permissions. I then get this error: bash: ./main.o: cannot execute binary file: Exec format error. Will you help me fix this? Also if it helps I'm using C.
-Thank you in advance
file ./main.oreturn? or ifmain.ois not in the current directory, find the file and then run thefilecommand on themain.oto show what type of file it is. – mchid Sep 23 '21 at 19:00sudo apt install build-essential? This is the recommended way to download and install GCC. – mchid Sep 23 '21 at 19:07.ofile suggests you added the-coption, which suppresses linking to a final executable file – steeldriver Sep 23 '21 at 19:09build-essentialpackage after if that makes a difference – Dequog Sep 23 '21 at 19:35-c(and optionally add-o prognameif you want the executable to be namedprognamerather than the defaulta.out). – steeldriver Sep 23 '21 at 19:47/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function _start': (.text+0x24): undefined reference to 'main' collect2: error: ld returned 1 exit status– Dequog Sep 23 '21 at 19:57main.cppactually contain amainfunction? Is it really C or is it C++ (as suggested by the.cppsuffix)? If the latter, useg++in place ofgcc. If the former (C with a.cppsuffix) you may need to add-xcto direct gcc appropriately. – steeldriver Sep 23 '21 at 20:03main.cand yes it does contain themain()function also the-xccommand does nothing – Dequog Sep 23 '21 at 21:00-cpart which causes the other problem – Dequog Sep 24 '21 at 00:57