Skip to content

Support MinGW when building code as part of DLL #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mtangoo opened this issue Mar 6, 2016 · 3 comments
Closed

Support MinGW when building code as part of DLL #434

mtangoo opened this issue Mar 6, 2016 · 3 comments

Comments

@mtangoo
Copy link

mtangoo commented Mar 6, 2016

I use amalgamated code and I found that when building jsoncpp as part of my DLL it have list of undefined reference. Checking the code, it only declare exports/imports only for MSVC. The following code in json.h works.

If I get time I will send PR but for now here is the relevant part of the code in case one can fix it.

#ifdef JSON_IN_CPPTL
#define JSON_API CPPTL_API
#elif defined(JSON_DLL_BUILD)
#if defined(_MSC_VER) || defined(__GNUC__)
#define JSON_API __declspec(dllexport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#elif defined(JSON_DLL)
#if defined(_MSC_VER)  || defined(__GNUC__)
#define JSON_API __declspec(dllimport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#endif // ifdef JSON_IN_CPPTL
#if !defined(JSON_API)
#define JSON_API
#endif
@cdunn2001
Copy link
Contributor

A PR would be helpful. Thanks.

@ya1gaurav
Copy link
Contributor

Shall I send PR with above code?

@mtangoo
Copy link
Author

mtangoo commented Mar 8, 2016

No it's not copy and paste. This code is from amalgamated file. So you need to go through files and add missing MinGw entries

ya1gaurav added a commit to ya1gaurav/jsoncpp that referenced this issue Mar 8, 2016
This is PR for open-source-parsers#434
It will fix reported build error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants