Compiling questions

Jun 29, 2015 at 2:39 PM
Hey guys, I'm following the instructions here but it seems I'm still missing something.

This should be able to compile with VS2013 right? I'm running VS2013 Community which as I understand should be very similar to the normal VS pro versions.

It kinda looks like I need newer versions of 'cqlib.lib' and 'spatialindex-mw.lib'. I found them in support/lib/v100 but when I copied all that into a v120 folder it came up with an error that looks like it's saying the spatial index lib wants an older compiler.

This is what that error looks like:
error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in Identifier.obj C:\dev\MapwinGIS\src\SpatialIndex-mw.lib(DiskStorageManager.obj) MapWinGIS

I don't know if it's important but I had to make a couple changes just to make it this far.
  • Comment out line 58 in MapWinGIS.cpp
    I read something about AfxSetAmbientActCtx(bool) not being supported in VS2013 so maybe that's why it was giving an error?
  • Change the version number in the linker from 4.9.3.4 to 4.9
    Again, found something that said this changed recently and version numbers with more decades had to go somewhere else.
  • Remove mfcs100.lib from the linker input dependancies
    A holdout from an older version of VS?
Developer
Jun 29, 2015 at 6:01 PM
Hi, it's important which branch you are compiling. Master branch is still compiled with VS2010 (we didn't want to change runtime until the next 4.9.4 release). So, yes, it needs a bit of work to make it compile with VS2013, like rebuilding support libs and perhaps the issues that you mentioned. On the other hand, dev494 branch is already compiled with VS2013, so perhaps you can get some ideas from it. Please let me know if you have further problems doing it.

Hope this helps,
Sergei
Jun 29, 2015 at 6:15 PM
Okay I didn't even think to look for another branch! I'll give that a try, Thanks.
Jun 30, 2015 at 4:25 PM
Yeah, that was what I needed to compile the ocx. I was even able to get the normal branch to compile by recompiling the support libraries.

I think I'm missing something trying to compile the AxInterop.MapWinGIS.dll though. It compiles successfully, but when I try to use it, it looks like the AxMap class doesn't have AxHost as a base class. Gives a bunch of errors relating to all of the activex window controls. This happens on both branches.

The class declaration in AxMap.cs is "public class AxMap". Should it be something like "public class AxMap : AxHost" or am I looking in the wrong place?
Developer
Jun 30, 2015 at 4:35 PM
You don't need to compile AxInterop.MapWinGIS.dll yourself. It's .NET primary interop assembly for Map control. It's generated automatically when you add Map control to the form designer in Visual Studio. It also can be created manually using AxImp.exe utility, though it's rarely needed. Perhaps the source of confusion is our documentation project (in docs subfolder) - its purpose is generation of documentation, nothing else.
Jul 2, 2015 at 2:01 PM
That makes a lot more sense! Yeah, I was confused by the documentation project since it compiled a dll, didn't realize those were generated automatically. Looks like I've got it all working now, thanks for the help!