[OSRS-PROJ] Re: [Mapserver-users] link problem proj4 on VC7

Frank Warmerdam warmerdam at pobox.com
Tue Nov 11 09:12:51 EST 2003

Yvain Ballini wrote:
> Hello,
> I'm trying to compile Mapserver with Visual Studio 2003 (precisely VC7) 
> on Windows 2000, and I've got everything except the Proj.4 library. I've 
> downloaded at  ftp://ftp.remotesensing.org/pub/proj/proj-4.4.3.zip., 
> like i'ts said it on the page 
> _http://mapserver.gis.umn.edu/doc40/win32_compile-howto.html_.
> When I try to compile this library (proj4.lib), I' meet a linking 
> problem that I can't explain. It gives me the following error:
> *proj.obj : error LNK2022: metadata operation failed (8013118D) : 
> Inconsistent layout information in duplicated types (PJconsts)*
> I've controlled that the structure PJconsts is defined and declared only 
> one time (in the header projects.h) and I don't find where is the problem.
> Do you know if there is some patch or these files to make the 
> compilation without problem?
> Thank you very much for your help.
> Best regards.


This is more properly a PROJ.4 issue.  I have built PROJ.4 with Visual Studio
.NET, but not the most recent version of that.  It would appear it is getting
more picky all the time.

The likely issue with PJconsts is that the structure includes the PROJ_PARMS__
macro, which basically expands to be a different set of projection specific
parameters in each of the low level projection support files.  I guess Visual
Studio is trying to keep track of all this for debugging purposes and is getting

Are you using the default makefile.vc build definitions?  By default the
OPTFLAGS is set to /Ox with no debug support enabled.  I would have thought
this would have avoided such issues.

I am not intending to upgrade to this compiler in the immediate future so
I can't really offer to fix the problem ... whatever that fix might be.
I would suggest you just grab a PROJ.DLL and corresponding import library
from a Visual Studio 6 build and use that.

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

PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list