Is there any way to compile a Windows DLL in MinGW/MSYS2 with the desired exported symbols without annotating the source code with _declspec(dllexport)?
Build DLL in MinGW/MSYS2 without declspec(dllexport)
1.6k Views Asked by BenK At
1
There are 1 best solutions below
Related Questions in DLL
- C++ using std::vector across boundaries
- Linking to a static lib compiled with MSVC
- What are MATLAB DLLS?
- VC++ .net: Functionality from managed DLL is not exported
- DLL being marked as DELETEPENDING
- ASP.NET Web Forms give error while connecting to Oracle 11g
- Air Native Extensions: Released Air App w/Windows Native Extension works fine on develpment PC but not on other computers
- WiX and custom extensions for primary output?
- Using different versions of the same DLL in a project
- visual c++ - missing unrelated DLLs
- Error executing SSIS Package
- C++ Access violation write to 0x00000000 in dll in mql4
- How can I read embedded .resx in different assembly
- Running two versions of same Dll parallel in Asp.Net
- Call class member of c++ DLL from c#
Related Questions in MINGW
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Error trying to generate Makefile for glBinding
- Role of __WORDSIZE in compilation
- What is the difference between MinGW SEH and MinGW SJLJ?
- MinGW error when compiling C: The procedure entry point libintl_setlocale could not be located in the DLL-file as.exe
- Windows 8.1 Pro MinGW Gfortran Command Prompt 'not recognized command' error
- Compiling PDCurses into ".a", error with mingw command
- How to convert a msys shell script into a windows exe file
- Error when compiling simple LLVM example with Mingw
- GCC suddenly stopped working? Missing dependencies?
- GCC exiting with an error 1 even with -Wall. No explanation why?
- Can't link wxWidgets app with Code::Blocks / MinGW
- Install PyAV on Windows
- Must compile Opencv with Mingw in order to use in QT under Windows?
- MinGW's ld cannot perform PE operations on non PE output file
Related Questions in MSYS2
- cURL link error with MinGW-w64 GCC on MSYS2
- GTK3: Mouse vanishes when using drag and drop
- Compiling GIMP from source code
- MSYS2 specify version of mingw32 or mingw64 gcc
- GtkOverlay not passing through input events
- only one instace of gtk applications allowed when compiler under windows msys2?
- Cmake FILE() command prepends other path to provided file path
- How to get native windows path inside msys python?
- CTRL+C does not work in msys2
- How to populate a GtkMenu with some GtkMenuItem and set its parent in Glade?
- How can I set the label of a GtkLinkButton in Glade?
- How to call msys2 find command from PowerShell with correct shell escape characters?
- compiling gtk+3 project with msys on windows
- How to configure cmake for msys2
- msys2, using standard windows console
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You probably already solved the problem, it has been over a year, but other people might have this problem, so:
Yes in MinGW you don't have to add the
declspec(dllexport)and a good reason might be that you just want to use someone else's library source without modifying/forking it.Here is an example
lib.cthat will be compiled into a DLL and exportingfuncwith the Makefile below:And a
lib.hfor usage in the executable:The
Makefile, but make sure that you fix the indentation: the two indented lines need a tab instead of 4 spaces:Note that the
-sharedis, what makes the output into a valid DLL and makes it exportfunc.Example
ex.cfor testing purposes: