public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Linking a native msvc dll library to CYGWIN g++ compiler
@ 2023-07-11  6:47 Mümin A.
  2023-07-12  6:24 ` Csaba Ráduly
  2023-07-17  6:58 ` Mümin A.
  0 siblings, 2 replies; 4+ messages in thread
From: Mümin A. @ 2023-07-11  6:47 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 587 bytes --]

Hi,

I'm facing a problem while linking my native dll library into the g++
compiler.

There is a name mangling problem when calling a msvc function from g++
compiler therefore linker gives an error undefined reference.

Is there any method to directly link and call a function from native dll
library from the cygwin compiler ?



For example, I've a fooCls.h header file for a windows library,  I add link
the fooCls.dll to g++ compiler then,

fooNameSpace::fooConnectionCls instance;
instance.FooTest();

gives a linker error , undefined reference.


Thank you in advance,
Mumin AYDIN

[-- Attachment #2: fooCls.h --]
[-- Type: text/plain, Size: 352 bytes --]

#ifndef FOOCLS_H
#define FOOCLS_H

#if defined(_WIN32)
#ifdef DLL_EXPORT
#define _WIN_DLL __declspec(dllexport)
#else
#define _WIN_DLL __declspec(dllimport)
#endif
#else
#define _WIN_DLL
#endif

namespace fooNameSpace
{

    class _WIN_DLL fooConnectionCls
    {
    public:
        void FooTest();
    };

}

#endif // FOOCLS_H

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-17  8:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11  6:47 Linking a native msvc dll library to CYGWIN g++ compiler Mümin A.
2023-07-12  6:24 ` Csaba Ráduly
2023-07-17  6:58 ` Mümin A.
2023-07-17  8:04   ` Mark Geisert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).