Please Help!! Calling Socket function in a dll file (that is created using cygwin library), by a Microsoft Visual C++ program resulting in infinite loop

Larry Hall (Cygwin)
Fri May 11 01:57:00 GMT 2007

kalasad mailu wrote:
> This question is also regarding my efforts to create a dll file using
> g++ in cygwin and use it in VC++.
> The below program works fine and the output is also shown below. But
> IF I UNCOMMENT THE TWO LINES in my file dtest.cpp i.e.
> //#include<iostream>
> //std::cout<<"hello naumskara\n";
> and do the same steps. Dll is created successfully, and the MSVC++
> compiles fine. But when I try to run it, I get the following msg when
> it tries to execute the init(); (to initialize the cygwin environment)
> function(MSVC++ file):
> ------------------------------------------------------------------------------------------------------------
> First-chance exception at 0x610b48b6 in new3.exe: 0xC0000005: Access
> violation reading location 0x00000004.
> -------------------------------------------------------------------------------------------------------------
> I am running the MSVC++ program from the IDE.
> Could you please suggest me how to make the program(MSVC++) work after
> un-commenting the line.


You're mixing and matching I/O from two different CRTs.  You can't do that.

Larry Hall                    
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746


A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list