[Proj] c++, Visual Studio .Net project

Andy Canfield andy.canfield at gmail.com
Thu Mar 2 14:37:14 EST 2006


PROJ is thread safe but not garbage collection/.Net CLR safe so
whatever functions you are using you will probably have to wrap in
C++\CLI or use PInvoke if you are trying to compile with the .Net CLR
on. If you want to compile with the CLR off and just use Visual C++ as
a more or less standards compliant C++ compiler then make sure you
turn off all the CLR garbage before you try and compile it. Also see
what the .lib you are linking against was created with. If it is a
.lib created with gcc or other compiler/linker combo  then you will
get a "fatal error LNK1136" because VC++'s linker can't read the .lib
file format created by gcc and vice versa. Same with .obj and .o
files. The formats are incompatible. So try compiling the PROJ lib
using VC++ and then try linking it and see if that helps. Or just
chuck .Net out the Window and use a compliant compiler and linker ;)


On 3/2/06, Eric Miller <EMiller at dfg.ca.gov> wrote:
> Haven't tried a C++ .NET combo w/ PROJ.4.  First, you might start with a more recent version of the library.
>
> However, I think there may be threading problems trying to use proj.lib directly from a managed C++ application.  I don't think the PROJ library is compiled as multithreaded and I don't think it is safe to do so.  However, managed C++ must be compiled as multi-threaded.  I just did a rudimentary attempt with the 4.4.8 sources I have, and I couldn't get it to link due to multiply defined library functions (LINK2005).  This is most likely because single- and multi-threaded library functions of the same name are being pulled in.
>
> You can probably use the library through Platform Invoke as I have done for C# programs.  But, it adds some work.
>
> >>> sven_ger at users.sourceforge.net 3/2/2006 8:01:06 AM >>>
> Hey all,
> I don't use PROJ.4 until now.
> At the moment I work at an 'little' project. In this one I should
> convert some coordinates from the German GK System to WGS84.
> I guess I can do it with PROJ.4.
>
> Now my question. Is there any possibility to integrate PROJ.4 into
> my existing Visual Studio .Net C++ project? I tried to link to
> proj446.lib but the complier said: fatal error LNK1136.
>
> At http://www.remotesensing.org/proj/ I don't find any example or
> something like this.
> I hope someone can help me.
>
> Regards,
> Sven
>
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>



More information about the Proj mailing list