News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

codeblocks wont compile - main functino first defined?

Started by dipsi, February 06, 2017, 01:51:15 PM

Previous topic - Next topic

dipsi

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.


||=== 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)) ===|

BlueHazzard

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...