This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Using main() from a shared library in Cygwin 1.7
Ferenc Kovacs <derefer <at> gmail.com> writes:
...
> I have an application, which links with a shared library (fairly common
> situation :)). This shared library provides the main() function. This
> approach works well on Linux/Solaris machines, but on Cygwin 1.7
> I get the following link error:
...
Hi Ferenc,
some years ago I had a problem with main function in a library under VMS
The linker just didn't search for it in a library.
To force it to search a reference in a non-library part of source did help.
I just added the following code in the main source file:
extern int main();
static int (*force_linker_search_for_main_in_library)() = main;
maybe something similar will help you
regards
kf
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple