Linking a native msvc dll library to CYGWIN g++ compiler
Mümin A.
muminaydin06@gmail.com
Tue Jul 11 06:47:14 GMT 2023
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
-------------- next part --------------
#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
More information about the Cygwin
mailing list