delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/27/11:26:56

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <6910a60805270826p3dafd3aaub2e700fd8fbd41d5@mail.gmail.com>
Date: Tue, 27 May 2008 17:26:18 +0200
From: "Reini Urban" <rurban AT x-ray DOT at>
To: cygwin AT cygwin DOT com
Subject: Re: Urgent !!! Reg Linking sybase DLL in cygwin..
In-Reply-To: <182dc94a0805270620n3448e0bakfc019f212282b93@mail.gmail.com>
MIME-Version: 1.0
References: <182dc94a0805270620n3448e0bakfc019f212282b93 AT mail DOT gmail DOT com>
X-Google-Sender-Auth: 842e752f9d6d8519
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

2008/5/27 Mani kandan <kvmani76 AT gmail DOT com>:
> I keep forgetting it can do that these days :(
>
>> The only real reason you need an import library is if
>> you're doing things like adding aliases for symbol names, or you need to
>> remove stdcall name decorations.  (Or if you need the name indirection
>> that an import library provides, e.g. being able to have -lfoo refer to
>> libfoo.dll.a which refers to cygfoo-12.dll.)  But if you simply want to
>> link against a DLL you can do so directly without any of the mess of
>> pexports or def files or import libs or whatnot.
>
>  Perhaps it's time that OP explain exactly /what/ the problem is; I did
> assume that a straightforward "-lfoo" must already have not worked in some
> way.  Mani?
>
> =================================================
>
> Hi,
>
>   Yes, I am not able to link directly sybase .dll in g++ compiler in cygwin.
>   I have created .def file with help of dumpbin command. I have
> modified the .def file.
>   My .def file will be
>   EXPORTS
>
>        JagCppProcess_main
>        delete_JagCppProcess
>        new_JagCppProcess
>        new_JagSIOPStream
>
>   With help of dlltool command i have created .a file also. Now i can
> able to link and
>   i got the EXE also. But while running the exe, i got the error message
>   _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
>   I want to clarify the following things
>   (i) Can i use dumpbin to get the .def file?
>   (ii) Why the exception thrown ?
>
>   But when i run the same sample code arith.cpp in windows
> environment, i am getting the result.

You are meaning with MSVC?
Or with mingw32 g++?

You cannot link a c++ dll with a different compiler / linker at all in general.
If this sybase.dll was not generated with the cygwin g++, you will not be able
to link to it with the cygwin g++.
There is the simple name mangling issue which you circumvented with
the explicit .def file,
and there is  the conflict of underlying exceptions and memory models.
A new/free in the sybase dll will not cooperate with a cygwin
new/free. A sybase.dll exception will not be caught
by your cygwin app.

If it was generated with MSVC you have to use MSVC.

Ask your vendor for a cygwin dll or sourcecode.
-- 
Reini Urban
http://phpwiki.org/ http://murbreak.at/

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019