Creating dll in cygwin gives "Undefined reference" errors

Brian Dessent
Sat Jul 28 15:04:00 GMT 2007

Pradip Jadav wrote:

> But when I compiles in cygwin it gives me some "Undefined reference" errors.
> Take an example,
>  /cygdrive/e/DOCUME~1/LOCALS~1/Temp/ccLMFYUe.o:sample.c:(.text+0x4c):
> undefined reference to `createlog(int, char*, ...)'
> Now this "createlog" function is defined in one of .cpp file of my
> main program.(Just for your information)
> Can you help me to solve problem of "undefined reference" ??

The undefined reference is because fundamentally ELF (Linux) and PE/COFF
(Windows) are very different in terms of how linking works under the
hood.  The short explanation is that PE/COFF requires all references to
be resolved at link-time, thus you have to explicitly tell the linker
where createlog() is to be found.

But I've typed this explanation so many times, I think I'll just start
linking to past copies of it:


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list