Hi,

I can only link one function at a time in a *msvc *built library but when I
use multiple functions in the CYGWIN
compiler,  I got that error message.

int main()
{
helloWorld2();
return 0;
}

That is compiled and linked successfully.

int main()
{
helloWorld2();
helloWorld3();
return 0;
}

That is  compiled but linking throws  a bug report.

[ 50%] Linking CXX executable a.exe
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
internal error: aborting at
/mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527
in compare_section
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
please report this bug
#ifndef FOOCLS_H
#define FOOCLS_H

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

#ifdef __cplusplus
extern "C"
{
#endif

     _WIN_DLL  void helloWorld2(void);
     _WIN_DLL  void helloWorld3(void);

#ifdef __cplusplus
}
#endif

#endif // FOOCLS_H
#include <fooCls.h>

int main()
{
        helloWorld2();
        
        helloWorld3();  

        return 0;
}
-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to