Mechanized Assault & eXploration Reloaded



#1 Jul 20, 2014 11:02 pm
ness Offline
Developer
Registered since: Nov 12, 2010
Posts: 59


Subject: For DEV: Compilation with MSVC2013
[Note: can't create the thread in dev section, admin may move this]

Hi all,

Great job with git migration, it is really fun to use Smiling

I just had a small problem that I wanted to ticket; when i compiled againqt MSVC2013 (on Windows 8.1)
(menu_event_refactoring branch, commit de7b04e9c9ec790a4b0a53a4e5ba33deab287040)

In settings.cpp:
"SHGetFolderPath" is deprecated (VS2013) replaced by SHGetKnownFolderPath that is only supported from VISTA

I simply skip this out of my build and everything else was fine Smiling
But maybe we should have a better patch Wink
This post has been edited 1 times. Last edit on Jul 20, 2014 11:03 pm by ness. ↑  ↓

#2 Jul 21, 2014 12:50 pm
alzi alzi Offline
Developer, Moderator
Registered since: Aug 12, 2007
Posts: 339


Subject: Re: For DEV: Compilation with MSVC2013
I do compile with VS2013 on Windows 8.1 as well and it works without problems here (I do not even get a warning).

You are right that "SHGetFolderPath" is deprecated, but it should still be available for backwards compatibility. The documentation says for Vista and higher it is just a wrapper around "SHGetKnownFolderPath".

The documentation for "SHGetKnownFolderPath" says that the minimum client version is Vista, so if I understand it correctly the binary will not work any longer on Windows XP if we use that function. Since I do not have an XP PC, I can not test that (would need to set up a VM for that).

So I'm not sure what the best solution would be. I have not very much experience with cross platform home directory stuff.

Maybe can use an environment variable, just like we do for linux. "%USERPROFILE%" should be the right one, but I do not know how robust this solution would be.
Albert Ziegenhagel
↑  ↓

#3 Jul 21, 2014 8:47 pm
ness Offline
Developer
Registered since: Nov 12, 2010
Posts: 59


Subject: Re: For DEV: Compilation with MSVC2013
I get a link error :
DownloadSource code (C++):
  1. settings.obj : error LNK2019: symbole externe non résolu __imp__SHGetFolderPathW@20 référencé dans la fonction "private: void __thiscall cSettings::setPaths(void)" (?setPaths@cSettings@@AAEXXZ)
  2. debug\maxr.exe : fatal error LNK1120: 1 externes non résolus

Maybe i miss some libs in the link step ?
↑  ↓

#4 Jul 21, 2014 9:27 pm
alzi alzi Offline
Developer, Moderator
Registered since: Aug 12, 2007
Posts: 339


Subject: Re: For DEV: Compilation with MSVC2013
Hm, strange.

It should be in "Shell32.lib" and that should be a default library. You may want to check whether it has been removed from there for some reasons.

btw: do you have set up an own project for VS or do you use the one I uploaded to the mk/vs folder?

Have you tried to compile the master instead of the branch? (there is the same function call to "SHGetFolderPath" in there)
Albert Ziegenhagel
↑  ↓

#5 Jul 22, 2014 10:03 am
ness Offline
Developer
Registered since: Nov 12, 2010
Posts: 59


Subject: Re: For DEV: Compilation with MSVC2013
I made my own project file from QtCreator,
it should come from there, I'll try the VS project ..
↑  ↓

#6 Jul 22, 2014 11:26 am
alzi alzi Offline
Developer, Moderator
Registered since: Aug 12, 2007
Posts: 339


Subject: Re: For DEV: Compilation with MSVC2013
Oh I think I read somewhere that QtCreator is not adding all the default windows libraries, so maybe just adding Shell32.lib to your linker command will do the trick.
Albert Ziegenhagel
↑  ↓

#7 Jul 22, 2014 2:11 pm
ness Offline
Developer
Registered since: Nov 12, 2010
Posts: 59


Subject: Re: For DEV: Compilation with MSVC2013
You are correct, it was missing Smiling

Thanks
↑  ↓

Pages (1): 1


All times are GMT +02:00. Current time: 11:44 am.