mingw 3.4.5 missing dlfcn.h?

前端 未结 6 2230
遇见更好的自我
遇见更好的自我 2021-02-20 09:33

is it possible that my mingw 3.4.5 installation is faulty? or is this provided on some other library floating around?

in case you are wondering, dlfcn.h is where stuff l

相关标签:
6条回答
  • 2021-02-20 10:08

    mingw is an implenentation of a compiler for windows (a gcc port) implementing the win32 API. The functions in dlfcn.h (dlopen/dlsym et. al.) are POSIX, not windows, so no win32 implementation exists. There may be a wrapper in msys or cygwin, but I fear that the differences between the windows DLL and the ELF shared library mechanisms means you'll simply need to port to the windows APIs.

    0 讨论(0)
  • 2021-02-20 10:12

    dlfcn-win32 is a wrapper for dlfcn around the win32 dll functions

    0 讨论(0)
  • 2021-02-20 10:12

    I know this is an old question, but nonetheless still relevant today, regardless of the version of GCC from MinGW.org which may be in use.

    Those who have observed that MinGW is really intended for use with the native Win32 APIs, based on LoadLibrary() and GetProcAddress(), rather than the POSIX specific APIs declared in dlfcn.h, are completely correct; thus, MinGW.org has not traditionally provided any implementation of the dlfcn.h API functions.

    However, as of mingwrt-3.21, I needed to implement MinGW functionality which is akin to the POSIX use of dlsym() on the RTLD_DEFAULT address space. Consequently, from this version of the MinGW runtime onwards, I intend to maintain a conforming implementation of the POSIX dlfcn.h APIs, as a wrapper around the LoadLibrary(), GetProcAddress(), and PSAPI.DLL native Win32 APIs.

    0 讨论(0)
  • 2021-02-20 10:14

    I had this problem, and after installing dlfcn-win32-r19.tar.bz2 on windows under cygwin shell, the problem was solved.

    https://code.google.com/p/dlfcn-win32/downloads/detail?name=dlfcn-win32-r19.tar.bz2

    I hope this help other guys.

    0 讨论(0)
  • 2021-02-20 10:18

    It's not in my MinGW 3.4.5 installation, so I doubt your installation is faulty. I suppose the the MinGW maintainers expect you to use the Win32 functions supporting dynamic loading (LoadLibrary(), GetProcAddress(), etc.).

    0 讨论(0)
  • 2021-02-20 10:20

    dlfcn.h: No such file or directory

    To solve this I had to add to the .pro file :

    DEFINES += _WINDOWS
    
    0 讨论(0)
提交回复
热议问题