Unable to find entry point _mainCRTStartup function while linking

Jim Balter jqb@netcom.com
Fri Apr 4 17:25:00 GMT 1997

Vassan, S. S. wrote:
> Dear Support:

This mailing list is a place where users of GNU-win32
hang out, and so what "support" you will get is a matter of
whether we fellow users happen to know the answers to your
questions.  It is not a Cygnus support channel, and people from Cygnus
rarely participate.  If you want support from Cygnus, you need to buy

> I recently downloaded Beta17.1(latest) of GNU-win32  from the net.
> I downloaded only the binaries and development tools( DIDNT get the
> source
> or recompile/relink the executables). This was installed in Windows NT
> 4.0.
> When I tried to link a program it says
> "Unable to find the main entrypoint _mainCRTStartup assuming the main
> entry point at..."

Do you mean _WinMainCRTStartup?  Did you compile with
--subsystem windows?  Did the program fail when you ran it?
Please provide accurate and complete details.

> I scanned all the directories and found
> "\cygnus\h-i386-cygwin32\i386-cygwin32\lib\ldscripts\i386pe.* "
> which have this entry point defined in this.
> How to include this..? what am I supposed to do with this...
> I feel the binary versions in the net are not properly configured for
> Windows NT,

Many of us are using them on Win NT, so that wouldn't seem to be the

> we may have to get the source file and start from beginning the three
> steps
> Configuration, compilation and installation... I dont have enough free
> disk for
> that..
> Is there any solution for this...?
> Additionally this version of linker is not able to recognise  .LIB files
> ..
> I have the MicroSoft  ODBC library with me .."ODBC32.LIB" which I tried
> to link using the option "-lodbc32". It came out with the message
> "ld.exe: Unable to open -lodbc32" always..

-lodbc32 means <standard library directory>/libodbc32.a, so that isn't
right.  With you own libraries, you just specify their path on the
command line.  But I think it is true that ld can't handle .LIB files. 

> I tried all permutations and combinations and was not successfull..
> Ultimately, I used "dlltool" to export all the functions from the DLL
> and create
> libodbc32.a -unix like library..
> But still I couldnt create ".EXE" due to the first error...

The first "error" you mentioned is a warning that normally
still creates a .exe, so if none was created that is probably for some
other reason.

<J Q B>
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

More information about the Cygwin mailing list