Error while compiling with MS visual C++ 2010 express

Status
Not open for further replies.

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
12,800
Location
France
Ok, starting with my first c++ noob question, got that trying to compile the source without changing anything in the code:

Code:
1>Lua\CvLuaPlayer.cpp(3445): error C2665: 'CvLuaMethodWrapper<Derived,InstanceType>::BasicLuaMethod' : none of the 4 overloads could convert all the argument types
1>          with
1>          [
1>              Derived=CvLuaPlayer,
1>              InstanceType=CvPlayerAI
1>          ]
1>          \Documents\Dev\CvGameCoreSource\CvGameCoreDLLUtil\include\CvLuaMethodWrapper.h(68): could be 'int CvLuaMethodWrapper<Derived,InstanceType>::BasicLuaMethod<TeamTypes>(lua_State *,ret (__thiscall CvPlayerAI::* )(void) const)'
1>          with
1>          [
1>              Derived=CvLuaPlayer,
1>              InstanceType=CvPlayerAI,
1>              ret=TeamTypes
1>          ]
1>          \Documents\Dev\CvGameCoreSource\CvGameCoreDLLUtil\include\CvLuaMethodWrapper.h(120): or       'int CvLuaMethodWrapper<Derived,InstanceType>::BasicLuaMethod<TeamTypes>(lua_State *,ret (__thiscall CvPlayerAI::* )(void))'
1>          with
1>          [
1>              Derived=CvLuaPlayer,
1>              InstanceType=CvPlayerAI,
1>              ret=TeamTypes
1>          ]
1>          \Documents\Dev\CvGameCoreSource\CvGameCoreDLLUtil\include\CvLuaMethodWrapper.h(39): or       'int CvLuaMethodWrapper<Derived,InstanceType>::BasicLuaMethod(lua_State *,void (__thiscall CvPlayerAI::* )(void) const)'
1>          with
1>          [
1>              Derived=CvLuaPlayer,
1>              InstanceType=CvPlayerAI
1>          ]
1>          \Documents\Dev\CvGameCoreSource\CvGameCoreDLLUtil\include\CvLuaMethodWrapper.h(50): or       'int CvLuaMethodWrapper<Derived,InstanceType>::BasicLuaMethod(lua_State *,void (__thiscall CvPlayerAI::* )(void))'
1>          with
1>          [
1>              Derived=CvLuaPlayer,
1>              InstanceType=CvPlayerAI
1>          ]
1>          while trying to match the argument list '(lua_State *, overloaded-function)'

any idea of what could be wrong with my configuration ?
 
ho, ok, thank you :goodjob:


Now the other problems I run into, if it can help others like myself...

If you get this:
Cannot open include file: 'unordered_set'

Get SP1 of visual C++ 2008

And if you get this:
cannot open include file 'afxres.h'

replace the line

Code:
#include "afxres.h"

with

Code:
#include "windows.h"

in CvGameCoreDLL.rc of both projects
 
The .vcproj and .vcxproj files for the G&K dll are also missing the necessary .def file entries to export the DLL entry point symbol - this stuff was tested ... right? :rolleyes:

Anyway, if you diff the .vcproj and .vcxproj files you'll find two major differences near the top

Code:
C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v sdk\CvGameCoreSource\CvGameCoreDLL
  CvGameCoreDLL.vcproj
    WholeProgramOptimization="1"
    ModuleDefinitionFile="$(ProjectDir)CvGameCoreDLL.def"

  CvGameCoreDLL.vcxproj
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <ModuleDefinitionFile>$(ProjectDir)CvGameCoreDLL.def</ModuleDefinitionFile>

Those lines are missing from

Code:
C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v sdk\CvGameCoreSource\CvGameCoreDLL_Expansion
  CvGameCoreDLL_Expansion1.vcproj
  CvGameCoreDLL_Expansion1.vcxproj
 
Point us in the direction of where to get this free and longer than a 30 day trial?
Muchos Gracias.
 
Point us in the direction of where to get this free and longer than a 30 day trial?
Muchos Gracias.

Both VS 2008 Express and VS 2010 Express are free downloads from the Microsoft web site - JFGI.

Once installed you can extend the 30-day trial for free by registering your copies on-line (usual MS bunk - they want you're email address, country, dev status, etc)
 
The .vcproj and .vcxproj files for the G&K dll are also missing the necessary .def file entries to export the DLL entry point symbol - this stuff was tested ... right? :rolleyes:

and thank you whoward69, with that fixed I've finally managed to compile something that does not crash the game before the main menu :D
 
and thank you whoward69, with that fixed I've finally managed to compile something that does not crash the game before the main menu :D

Are you loading your recompiled dll via a mod, or just over-writing the existing "C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\assets\DLC\Expansion\CvGameCore_Expansion1.dll" file?

I can now edit the stopwatch messages (eg in CvMapGenerator.cpp), over-write the .dll, start a game and see my messages in the stopwatch.log file, but can't for the life of me figure out the "magic" needed to load the dll from a mod.

Tried the obvious (and several variations) of add dll to mod (with and without vfs=true) and playing around with the Actions -> OnGetDLLPath -> SetDllPath stuff, but other than managing to crash the game in new and interesting ways, the dll doesn't load. (And yes, the mod is enabled and I'm starting the game from after the mod screen!)

W
 
Trying various ways to load the dll without over-writing the original, the lines in config.ini

Code:
; Sub-directory where the game code DLL resides, set to empty string to let the game decide
GameCoreSubDirectory =

are a complete red-herring, as the string "GameCoreSubDirectory" doesn't appear in any .exe/.dll (unlike all the other keys in that file), so must be an artifact from the pre-OnGetDLLPath versions
 
Are you loading your recompiled dll via a mod, or just over-writing the existing "C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\assets\DLC\Expansion\CvGameCore_Expansion1.dll" file?
I've done the test by overwritting the original DLL after failing at using the action as you tried, but finally it seems that a simple VFS=true with the modded DLL renamed to CvGameCoreDLLFinal Release.dll or CvGameCore_Expansion1.dll, depending on which version you have compiled, is working for me.

Don't know if it's the way it's supposed to work, but as it is I suppose you can have 1 mod for both versions of the game.
 
but finally it seems that a simple VFS=true with the modded DLL renamed to CvGameCoreDLLFinal Release.dll or CvGameCore_Expansion1.dll, depending on which version you have compiled, is working for me.

At work so can't try this, but are you saying just the correct name for the dll and vfs=true with no entry in the actions tab
 
Yes, no entry in the action tab. Puzzling...
 
Very weird ... makes you wonder why they even bothered adding the feature!

Can we get this thread "locked" and continue adding useful info in the How to compile the DLL thread - as it has a more meaning title, and a useful summary as the first post.
 
Yes, I've stickied the "How to compile the DLL" thread.

Moderator Action: And closed this one as it's a duplicate now.
 
Status
Not open for further replies.
Back
Top Bottom