[OSRS-PROJ] Linking Proj.4 in VC++

Frank Warmerdam warmerdam at pobox.com
Thu Sep 6 12:48:27 EDT 2001

Hawkswan at aol.com wrote:

> I compiled the proj.4 library under VC++ using the makefile.vc.  Everything
> went OK on that.  But when I try to link with the proj.lib, I get the
> following errors and warnings:  Any suggestions as to what's wrong here?
>  Thanks.
> Jere Swanson
> Linking...
> LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in
> msvcrtd.lib(MSVCRTD.dll)
> use /NODEFAULTLIB:library
> Debug/Wayne.exe : fatal error LNK1169: one or more multiply defined symbols
> found
> Error executing link.exe.


The problem is that PROJ is compiled with the default C library (LIBC) and
your application is presumably built with the debug C runtime DLL (MSVCRTD).
I would suggesting linking against the PROJ stub library (for the DLL)
instead of the static library.  The stub library should be proj_i.lib.

Alternatively you can rebuild PROJ with the same C library options as your
main project.  I think you would want to add /MDd to the CFLAGS definition
in makefile.vc.

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