Code::Blocks Forums

User forums => Help => Topic started by: mathguy on November 16, 2011, 10:03:42 pm

Title: Compiler Looking for main.c
Post by: mathguy on November 16, 2011, 10:03:42 pm
I'm moving forward slowly but surely.  I am trying to produce a DLL.  When it gets to the linking stage, it fails because it is looking for main.o.  My program does not have a main.c file.  What do I set in CodeBlocks to prevent that error from tripping up the build and link?
Title: Re: Compiler Looking for main.c
Post by: oBFusCATed on November 16, 2011, 10:31:08 pm
Start reading here: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
Title: Re: Compiler Looking for main.c
Post by: zabzonk on November 16, 2011, 11:02:45 pm
DLLs do not require a main.o, a main.c or indeed a main() function. Somehow you have added a main.c to your project - somehow you need to get rid of it.
Title: Re: Compiler Looking for main.c
Post by: oBFusCATed on November 16, 2011, 11:14:10 pm
Having main.c doesn't mean there is main(...) function in it.
In fact on Windows you have dllmain one.
And also c::b project template creates a main.c or main.cpp file.
Title: Re: Compiler Looking for main.c
Post by: zabzonk on November 16, 2011, 11:16:27 pm
> Having main.c doesn't mean there is main(...) function in it.

I didn't say it did.

> In fact on Windows you have dllmain one.

Which is optional.

> And also c::b project template creates a main.c or main.cpp file.

I know, that's why I suggested he got rid of it.
Title: Re: Compiler Looking for main.c
Post by: oBFusCATed on November 17, 2011, 07:31:16 am
Neil please reread your post to see what exactly you've suggested.