[Proj] Building proj.4 using Visual Studio 2008 IDE

Sjur Kolberg Sjur.A.Kolberg at sintef.no
Sat Dec 4 19:06:14 EST 2010


Thanks, Nicolas!

All I needed to do was to specify that file under Linker-Input as Module Definition file. I hadn't noticed it was there, and it didn't strike me that  the .def file I DUMPBIN'ed from the nmake build could be used that way. It all works now, after moving/copying some files between projects.

Sjur :-)


From: proj-bounces at lists.maptools.org [mailto:proj-bounces at lists.maptools.org] On Behalf Of nicolas david
Sent: 4. desember 2010 19:51
To: PROJ.4 and general Projections Discussions
Subject: Re: [Proj] Building proj.4 using Visual Studio 2008 IDE

hi

I think you should have a look to the "Exporting from a DLL using def files<http://msdn.microsoft.com/en-us/library/d91k01sh%28v=VS.90%29.aspx>" pages of Visual 2008 documentation. There is a proj.def file under proj4 "src" directory which contains the function to export.

hope it's helpful

Nicolas
2010/12/4 Sjur Kolberg <Sjur.A.Kolberg at sintef.no<mailto:Sjur.A.Kolberg at sintef.no>>

Hello,

Can anyone please answer what I guess is a newbie question:

I try to build proj.4 using Visual Studio 2008 IDE.

By following instructions, I managed to build proj.4 using the nmake utility. For possibly irrational reasons, nmake is a tool I'm uncomfortable with, so I tried to build proj4.dll by creating VS solution and project files. I separated the five outputs (proj.dll, geod.exe, nad2bin.exe, nad2nad.exe and cs2cs) into separate VS projects.

Building somehow works for proj.4, meaning that the dll is successfully created, but no stub library (proj_i.lib). Hence the remaining programs (cs2cs, nad2nad etc) either complain about proj_i.lib not found, or about unresolved externals. Also, DUMPBIN on the created proj.dll shows an empty list of exported symbols.

I have specified /IMPLIB:proj_i.lib, but this is ignored by VS, apparently connected to the fact that nothing is exported from proj.dll. From other libraries, I am used to find __declspec(dllexport) at the declaration of the exported symbols, but there is none of the like in the proj.4 source code. Is this Windows or VS specific?

Still the nmake utility obviously know what to export, DUMPBIN on the nmake-built proj.dll shows a well populated list. I have tried reading the .configure and makefile.vc<http://makefile.vc> files, but lack the skill to understand them.

I guess I could read the output from DUPMBIN on the nmake-generated proj.dll  and insert a __declspec(dllexport) in the source code declarations for all these symbols. Is this the only (non-nmake) way of getting these symbols exported from proj.4 under VS?

If I #defined a PROJ_DLL inside some #ifdef to mean __declspec(dllexport)  if (WIN32 and VS-IDE) and nothing otherwise, would anyone be interested in updated proj_api.h and the .sln+.vcproj files?

Regards,

Sjur K :-)



_______________________________________________
Proj mailing list
Proj at lists.maptools.org<mailto:Proj at lists.maptools.org>
http://lists.maptools.org/mailman/listinfo/proj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20101205/3ae688ac/attachment-0001.htm 


More information about the Proj mailing list