2019-08-26 11:28 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006055Spring engineGeneralpublic2018-10-19 19:09
Reporterlhog 
Assigned ToKloot 
PrioritylowSeveritytweakReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006055: Can't build develop branch under VC++ 2017
DescriptionI've fixed:
1) missing libvorbisenc-2.dll in vclibs\dll
2) missing #include <array> in ArchiveLoader.h

but I struggle to fix the following:

Error LNK2001 unresolved external symbol "public: static class std::vector<struct QTPFS::NodeLayer,class std::allocator<struct QTPFS::NodeLayer> > QTPFS::PathManager::nodeLayers" (?nodeLayers@PathManager@QTPFS@@2V?$vector@UNodeLayer@QTPFS@@V?$allocator@UNodeLayer@QTPFS@@@std@@@std@@A) engine-legacy G:\_programming\zero-k\spring\build-VC\rts\builds\legacy\QTPFSPathDrawer.obj 1

Error LNK2001 unresolved external symbol "public: static class std::vector<struct QTPFS::INode *,class std::allocator<struct QTPFS::INode *> > QTPFS::PathManager::nodeTrees" (?nodeTrees@PathManager@QTPFS@@2V?$vector@PAUINode@QTPFS@@V?$allocator@PAUINode@QTPFS@@@std@@@std@@A) engine-legacy G:\_programming\zero-k\spring\build-VC\rts\builds\legacy\QTPFSPathDrawer.obj 1

Error LNK2001 unresolved external symbol "public: static class std::vector<struct QTPFS::PathCache,class std::allocator<struct QTPFS::PathCache> > QTPFS::PathManager::pathCaches" (?pathCaches@PathManager@QTPFS@@2V?$vector@UPathCache@QTPFS@@V?$allocator@UPathCache@QTPFS@@@std@@@std@@A) engine-legacy G:\_programming\zero-k\spring\build-VC\rts\builds\legacy\QTPFSPathDrawer.obj 1
Additional InformationIs this something that can be quickly fixed or disabled as QTPFS is not really widely adopted?
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0019413

Kloot (developer)

apparently MSVC is behind the times, try this:


diff --git a/rts/Sim/Path/QTPFS/PathManager.cpp b/rts/Sim/Path/QTPFS/PathManager.cpp
index 1288165..694b4eb 100644
--- a/rts/Sim/Path/QTPFS/PathManager.cpp
+++ b/rts/Sim/Path/QTPFS/PathManager.cpp
@@ -104,15 +104,15 @@ namespace QTPFS {
         const size_t numCores = Threading::GetLogicalCpuCores();
         return ((numThreads == 0)? numCores: numThreads);
     }
+}
 
- unsigned int PathManager::LAYERS_PER_UPDATE;
- unsigned int PathManager::MAX_TEAM_SEARCHES;
+unsigned int QTPFS::PathManager::LAYERS_PER_UPDATE;
+unsigned int QTPFS::PathManager::MAX_TEAM_SEARCHES;
 
- std::vector<NodeLayer> PathManager::nodeLayers;
- std::vector<QTNode*> PathManager::nodeTrees;
- std::vector<PathCache> PathManager::pathCaches;
- std::vector< std::vector<IPathSearch*> > PathManager::pathSearches;
-}
+std::vector<QTPFS::NodeLayer> QTPFS::PathManager::nodeLayers;
+std::vector<QTPFS::QTNode*> QTPFS::PathManager::nodeTrees;
+std::vector<QTPFS::PathCache> QTPFS::PathManager::pathCaches;
+std::vector< std::vector<QTPFS::IPathSearch*> > QTPFS::PathManager::pathSearches;

~0019414

lhog (reporter)

Exactly same errors

~0019415

Kloot (developer)

just work around it then:


diff --git a/rts/Sim/Path/QTPFS/PathManager.cpp b/rts/Sim/Path/QTPFS/PathManager.cpp
index 1288165..b15fb09 100644
--- a/rts/Sim/Path/QTPFS/PathManager.cpp
+++ b/rts/Sim/Path/QTPFS/PathManager.cpp
@@ -108,10 +108,10 @@ namespace QTPFS {
        unsigned int PathManager::LAYERS_PER_UPDATE;
        unsigned int PathManager::MAX_TEAM_SEARCHES;
 
- std::vector<NodeLayer> PathManager::nodeLayers;
- std::vector<QTNode*> PathManager::nodeTrees;
- std::vector<PathCache> PathManager::pathCaches;
- std::vector< std::vector<IPathSearch*> > PathManager::pathSearches;
+ // std::vector<NodeLayer> PathManager::nodeLayers;
+ // std::vector<QTNode*> PathManager::nodeTrees;
+ // std::vector<PathCache> PathManager::pathCaches;
+ // std::vector< std::vector<IPathSearch*> > PathManager::pathSearches;
 }
 
 
diff --git a/rts/Sim/Path/QTPFS/PathManager.hpp b/rts/Sim/Path/QTPFS/PathManager.hpp
index 5bca5a5..8bafb63 100644
--- a/rts/Sim/Path/QTPFS/PathManager.hpp
+++ b/rts/Sim/Path/QTPFS/PathManager.hpp
@@ -140,10 +140,10 @@ namespace QTPFS {
                std::string GetCacheDirName(const std::string& mapCheckSumHexStr, const std::string& modCheckSumHexStr) const;
                void Serialize(const std::string& cacheFileDir);
 
- static std::vector<NodeLayer> nodeLayers;
- static std::vector<QTNode*> nodeTrees;
- static std::vector<PathCache> pathCaches;
- static std::vector< std::vector<IPathSearch*> > pathSearches;
+ /*static*/ std::vector<NodeLayer> nodeLayers;
+ /*static*/ std::vector<QTNode*> nodeTrees;
+ /*static*/ std::vector<PathCache> pathCaches;
+ /*static*/ std::vector< std::vector<IPathSearch*> > pathSearches;

~0019416

lhog (reporter)

Ok, sorted that one out.

In PathManager.hpp moved:
static std::vector<QTPFS::NodeLayer> nodeLayers;
static std::vector<QTPFS::QTNode*> nodeTrees;
static std::vector<QTPFS::PathCache> pathCaches;
static std::vector< std::vector<QTPFS::IPathSearch*> > pathSearches;

from private: to public:

~0019417

lhog (reporter)

I can't claim even basic level of C++ knowledge, but it's a bit puzzling how other compilers allowed code, where private static variables of one class is accessed/assigned from other class.

~0019418

Kloot (developer)

ah, now I see the errors originated in QTPFSPathDrawer which has a

  #define private public

hack on top. this is just some unexpected difference in compiler/preprocessor behavior.

~0019419

lhog (reporter)

Oh, this is nasty :)

Reminds me immortal
#define TRUE FALSE //Happy debugging suckers
+Notes

-Issue History
Date Modified Username Field Change
2018-10-19 11:12 lhog New Issue
2018-10-19 13:20 Kloot Note Added: 0019413
2018-10-19 16:16 lhog Note Added: 0019414
2018-10-19 16:42 Kloot Note Added: 0019415
2018-10-19 16:44 lhog Note Added: 0019416
2018-10-19 16:49 lhog Note Added: 0019417
2018-10-19 17:15 Kloot Note Added: 0019418
2018-10-19 17:20 lhog Note Added: 0019419
2018-10-19 19:09 Kloot Assigned To => Kloot
2018-10-19 19:09 Kloot Status new => resolved
2018-10-19 19:09 Kloot Resolution open => fixed
2018-10-19 19:09 Kloot Fixed in Version => 104.0 +git
+Issue History