I'm new to Code::Blocks, until now I've written C programs in gedit and compiled with gcc on CLI.
When I compile with:
clang example.c -o example
I get an ~8kb file, and when I run "file example" I get:
example: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=f777e63be4eb01a07e3dea7e1b7adfff47150ded, not stripped
But when I build in C::B I get a 2kb file called example.o. When I file it I get:
example.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
I've looked inside Settings --> Compiler and everything looks normal to me there. It's set to GCC, clang isn't an option as far as I can see.
When I attempt to run example.o from C::B I get permission denied. Then after changing the permissions I get "cannot execute binary file: Exec format error"
Any suggestions? Thanks.
Thanks, it doesn't throw any errors when I hit build, but something is definitely wrong with the output file.
gcc -Wextra -Wall -std=c99 -c /home/user/Dropbox/code/example/example.c -o /home/user/Dropbox/code/example/example.o
g++ -o /home/user/Dropbox/code/example/example /home/user/Dropbox/code/example/example.o
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
When I compile the same source file in Eclipse CDT, it compiles and works normally, though it makes the file about 5 times as big as clang/gcc do... So it seems to me that I've missed something with CB in terms of configuration.