[Proj] Compilation under Windows; DLL issues

proj-admin at remotesensing.org proj-admin at remotesensing.org
Thu Apr 15 08:20:12 PDT 2004


I found, that to use the PROJ.4 library from Visual Basic, functions
also
need to use __stdcall.  I wrote a simple wrapper for the 4.4.6 build:
http://ftp.dfg.ca.gov/Outgoing/Nafwb/proj4/proj_api.zip 

Eric G. Miller
GIS Analyst
Wildlife and Habitat Data Analysis Branch
Department of Fish and Game

>>> proj-admin at remotesensing.org 4/15/2004 6:03:58 AM >>>

> Hi all,
> 
> There are some issues using libproj as a DLL under Windows.
> The way the definitions currently are, it is not possible to access
> pj_errno or pj_release.
> The reasons for that are:
> *) pj_release is not defined as an export in proj.def
> *) pj_errno needs __declspec(dllimport) in its declaration to be
accessible
> 
> The second issue is a tricky one. Methods don't need the
__declspec-stuff,
> they just get a second level of indirection in the code. Data,
however, need
> that.

Thomas,

To get access to the errno value, windows applications are expected to
call
pj_get_errno_ref() which returns a pointer to the pj_errno variable. 
While
your approach can work, I decided that depending on the ability to
export
variables from the DLL/shared library was likely to be a source of
problems,
so I provided the function access.

I should have done the same for pj_release, but I wasn't aware anyone
was using
it.  I have added a pj_get_release() function that will return the
pj_release
string in CVS.  This will appear in the next release.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com 
light and sound - activate the windows | http://pobox.com/~warmerdam 
and watch the world go round - Rush    | Geospatial Programmer for
Rent




More information about the Proj mailing list