-
Notifications
You must be signed in to change notification settings - Fork 785
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
Should we "import" symbols by default (Windows environment) ? #1821
Comments
That's where things are mysterious to me, and there's something odd in our current setup. __declspec(dllimport) shouldn't be mandatory according to https://blogs.msdn.microsoft.com/russellk/2005/03/20/lnk4217/ |
Shouldn't you be linking against a |
In bumped into some linking error when compiling PROJ-JNI.
The only way I could compile and link PROJ-JNI C++ part was to add the following line in CMakeList.txt : |
Ah indeed that makes sense then. The blog post I mentionned above does mention that explicit dllimport is needed for global variables. That said, now that PROJ-JNI is queued for removal (#1825), this ticket is probably obsolete |
@rouault PROJ-JNI is this: https://github.com/Kortforsyningen/PROJ-JNI/, not the old JNI-wrapper within PROJ itself. @FilipGh is trying to make PROJ integrate smoothly with the new bindings on Windows. |
Reading a bit more about that, I'm not sure we can unconditionnaly define PROJ_MSVC_DLL_IMPORT for _MSC_VER when including proj.h, because that would fail for people doing static linking. And looking for example at src/bin_cct.cmake, we can see that both conditions (MSVC + dll build) are used to determine when PROJ_MSVC_DLL_IMPORT is defined
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
In file
proj.h
, some macro definitions are set in order to import or export symbols in DLL:When linking an executable against
proj_6_x.dll
, it is mandatory to add the following option in the Visual C++ compiling command line:/D PROJ_MSVC_DLL_IMPORT
Shouldn't it be easier to "import" symbols by default, as:
at least in a Windows environment ?
The text was updated successfully, but these errors were encountered: