This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 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


kalasad mailu wrote:
> On 5/10/07, Larry Hall (Cygwin) <reply-to-list-only-lh <AT> cygwin <DOT> com> wrote:
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                 <http://cygwin.com/acronyms/#PCYMTNQREAIYR>
>> 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.
>>
>> See
>> <http://cygwin.com/faq/faq-nochunks.html#faq.programming.msvcrt-and-cygwin>
>>
>>
>> You're mixing and matching I/O from two different CRTs.  You can't do
>> that.
> 
> Why will it work if I comment these line. I am still mixing the
> cygwin1 and msvcrt.dll?


You're only playing with fire then. ;-)  Seriously, if you know what you're
doing, you can skirt the danger of all kinds of things... if you know what
you're doing.


-- 
Larry Hall                              http://www.rfk.com
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:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]