[Shapelib] Including shapelib.dll in Visual C++ 2008 Express project

Sanak geosanak at gmail.com
Sun Jun 21 07:42:43 EST 2009


Hi Raphael,

It seems that the original Visual C++ shapelib project preprocessor
definitions are invalid. (generated shapelib.lib and shapelib.dll symbols
are incompatible)

Please try as follows,
1. modify shapelib project C/C++ preprocessor definition from VC property
page
   SHPAPI_CALL=__stdcall
     --> SHAPELIB_DLLEXPORT
2. modify each source files(dbfopen.c/shpopen.c/shptree.c) C/C++
preprocessor definition from VC property page
  SHAPELIB_EXPORTS;SHPAPI_CALL=__stdcall;$(NoInherit)
     --> SHAPELIB_DLLEXPORT
3. rebuild shapelib project.
4. import generated shapelib.lib to your project and build.

Regards,

Sanak.

2009/6/21 raphael_mws <r.speck at minewolf.com>

>
> Hi folks,
>
> I am having a real hard time including the shapelib.dll in my VC++ 2008
> project. I did the following:
>
> - recompile the Visual C++ shapelib project from
> http://dl.maptools.org/dl/shapelib/contrib/DotNetArchive.zip. This worked
> fine, and I got the output dll and lib files.
>
> - include the shapefil.h in my .cpp file successfully
>
> - tried various possibilities to get the shapelib.dll in the correct PATH.
> Actually, it should be found by the compiler, I even tried putting it into
> C:\WINDOWS\system32 to make sure that's not the problem.
>
> - experimented with various combinations of __declspec( dllimport ) to
> import the functions from the dll
>
> When I try to compile, I always get the following error:
> "error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_SHPOpen" in
> Funktion "_wmain"."
> (in English: unreferenced extern symbol "... )
>
> Can anybody please give me a hint what I might be doing wrong? Or, even
> better, send me a sample VC project using shapelib.dll?
>
> Thanks and kind regards,
> Raphael
> --
> View this message in context:
> http://www.nabble.com/Including-shapelib.dll-in-Visual-C%2B%2B-2008-Express-project-tp24132517p24132517.html
> Sent from the ShapeLib mailing list archive at Nabble.com.
>
> _______________________________________________
> Shapelib mailing list
> Shapelib at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/shapelib
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/shapelib/attachments/20090621/30fbd5ff/attachment.htm 


More information about the Shapelib mailing list