Author Topic: codeblocks wont compile - main functino first defined?  (Read 2946 times)

Offline dipsi

  • Single posting newcomer
  • *
  • Posts: 2
codeblocks wont compile - main functino first defined?
« on: February 06, 2017, 01:51:15 pm »
I am still having problems compiling my C code in codeblocks. So I have used my own makefile (where codeblocks was just building but never running the code) and now I wanted to try it without. So the compiler returns the code I pasted below.

/the bbb is a external library I have linked to my code. ON line 13 in my main.c is the beginning of the main function.

Code
||=== Build: Debug in program (compiler: GNU GCC Compiler) ===|
/usr/local/bin/bbb||In function `_fini':|
/usr/local/bin/bbb||In function `data_start':|
/usr/local/bin/bbb||In function `data_start':|
/usr/local/bin/bbb||In function `_start':|
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o|| first defined here|
/usr/local/bin/bft||In function `main':|
obj/Debug/myCode/src/main.o:/home/MyName/Documents/myCode/src/main.c|13|first defined here|
/usr/local/bin/bbb||In function `_init':|
||error: ld returned 1 exit status|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: codeblocks wont compile - main functino first defined?
« Reply #1 on: February 06, 2017, 02:08:18 pm »
this does not seem to be the full build log...
it is difficult to solve this kind of problems without the full build parameters...

But it seems you have two main function on your project and the linker does not like this.... So you link one c file to much into the output file...