gcc links to libcmain when generating a dll
Jon Turney
jon.turney@dronecode.org.uk
Fri May 23 13:40:45 GMT 2025
On 23/05/2025 14:30, skidmarks via Cygwin wrote:
[...]
> Thanks!
>>> g++ -shared -flinker-output=dyn -o slip.dll *.o
>> ran with not errors.
>> Is there any documentation available on cygwin specific issues?
> This seems like a question that I should be able to answer on my
> own.
Indeed. We do ask people to read the FAQ before posting, and:
https://cygwin.com/faq.html#faq.programming.dll-building
points to
https://cygwin.com/cygwin-ug-net/dll.html
which is in need of updating, but mentions that you should use '-shared'.
But this isn't actually a Cygwin specific question. '-shared' is
actually the right flag to use everywhere.
> One residual question that a cygwin specific manual may answer> is
why libcmain.a was included at all.
Because the linker thinks you are making an executable, which has to
have a main function.
More information about the Cygwin
mailing list