MapScript C# (MapServer 4.10): mapscriptPINVOKE problem on 64-bit platform.

Hong ljfong at SDF.LONESTAR.ORG
Thu Jan 25 12:28:13 EST 2007


Yep I know I need 64-bit DLLs. The MapServer I used was compiled from the
source (buildkit) with very stripped down configurations, that was, no linkage
to MySQL, PDF generation library, GEOS, and others, as they were irrelevant to
what I needed. 

Looking at all the switches for cl.exe (visual c++ compiler), link.exe (visual
c++ linker), and csc.exe (c# compiler), I did not notice any specific switch
to produce 64-bit code. Since I compiled it using Visual Studio 2005 installed
and running on a 64-bit machine, I think the code produced should run on a
64-bit machine. Apparently it is just not that simple. I'm starting to think
it was either incorrect CRT library being loaded or the SWIG binary I used to
produce the c# mapscript binding DLLs was not 64-bit. I'm still at loss
however.

Nope, I doubt it would make a difference to have AMD processor, after all AMD
architecture is virtually the same as Intel one, as far as assembly
instructions go. Unless the software has to interact with the processor
directly and make use of processor specific assembly instructions in some way,
which I don't think applies to MapServer, it should not matter.

Hong.

On Thu, Jan 25, 2007 at 10:34:21AM +0100, Tobias.Knoetzele at atosorigin.com wrote:
> Hi,
> 
> I don?t know much about C and the very special Error you had.
> But I know that 
> - there are dependencies between the DLLs 
> - you need 64-Bit DLLs
> - I didn?t manage to get the DLLs required as 64 Bit - one isn?t Open Source and the producer says it?s not available for 64Bit Windows.
> 
> Maybe this helps you.
> 
> If you say you?ve got all the DLLs as 64 Bit - then I?d love to have them. Do you know wether it makes a difference to have AMD Processors?
> 
> These are the DLLs required:
> ssleay32.dll 
> xerces-c_2_7.dll 
> zlib1.dll 
> bgd.dll 
> gdal13.dll 
> geos_c.dll 
> geotiff.dll 
> iconv.dll 
> libcurl.dll 
> libeay32.dll 
> libecwj2.dll 
> libmap.dll 
> libmysql.dll 
> libpq.dll 
> libtiff.dll 
> libxml2.dll 
> lti_dsdk_dll.dll 
> mapscript.dll 
> pdflib.dll 
> proj.dll 
> 
> Tobias
> 
> -----Urspr?ngliche Nachricht-----
> Von: UMN MapServer Users List [mailto:MAPSERVER-USERS at lists.umn.edu] Im Auftrag von Hong
> Gesendet: Donnerstag, 25. Januar 2007 01:49
> An: MAPSERVER-USERS at lists.umn.edu
> Betreff: [UMN_MAPSERVER-USERS] MapScript C# (MapServer 4.10): mapscriptPINVOKE problem on 64-bit platform.
> 
> Hi,
> 
> I was trying to run mapserver compiled on a 64-bit Intel dual xeon processor machine running Windows Server 2003 R2 64-bit edition. On map object creation, the subroutine threw an exception "The type initializer for 'mapscriptPINVOKE'
> threw an exception.". The stack trace was:
> 
> at mapscriptPINVOKE.new_mapObj(String jarg1) at mapObj..ctor(String filename)
> 
> I wrote a small test C++ application on the 64-bit machine that tried to create a map object by compiling and linking it to mapscript.lib and mapscript_i.lib. The application ended up with the error:
> 
> Debug Assertion Failed!
> Program: D:\TGI\Developer\MapServerTest\debug\MapServerTest.exe
> File: dbgheap.c
> Line: 1252
> 
> Expression: _CrtIsValidHeapPointer(pUserData)
> 
> So it looked like I was having problem with the CRT library on the 64-bit machine. Looking at libmap.dll revealed that it depended on c:\windows\syswow64\MSVCRT.DLL (is this the correct CRT to load?)
> 
> The compiler was MS Visual Studio 2005.
> 
> The C++ test program itself:
> 
> // MapServerTest.cpp : Defines the entry point for the console application.
> //
> 
> #include "stdafx.h"
> #include <iostream>
> #include "map.h"
> 
> 
> int _tmain(int argc, _TCHAR* argv[])
> {
> 	std::cout << "Hello World" << std::endl;
> 
> 	mapObj* p_mapObj = msNewMapObj();
> 
> 	return 0;
> }
> 
> At this point I'm stumped on where to proceed next and can use any help/suggestion.
> 
> Hong
> 



More information about the mapserver-users mailing list