nickgillian / grt

gesture recognition toolkit
859 stars 285 forks source link

Windows CMake File doesn't compile all examples / tests #114

Open morphogencc opened 7 years ago

morphogencc commented 7 years ago

I followed your instructions for building the GRT static libs in Visual Studio, but I get several errors while compiling (even the 32-bit version out of the box):

All of the errors seem derived from an issue with compiling Random::Random():

"C:\Users\morphogencc\Downloads\grt\build\tmp\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\morphogencc\Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj" (default target) (89) ->
  TimeSeriesClassificationDataStreamExample.obj : error LNK2019: unresolved external symbol "public: __cdecl GRT::Random::Random(void)" (??0Random@GRT@@QEAA@XZ) referenced in func
tion main [C:\Users\morphogencc\Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj]
  TimeSeriesClassificationDataStreamExample.obj : error LNK2019: unresolved external symbol "public: __cdecl GRT::Random::~Random(void)" (??1Random@GRT@@QEAA@XZ) referenced in fun
ction main [C:\Users\morphogencc\Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj]
  TimeSeriesClassificationDataStreamExample.obj : error LNK2019: unresolved external symbol "public: int __cdecl GRT::Random::getRandomNumberInt(int,int)" (?getRandomNumberInt@Ran
dom@GRT@@QEAAHHH@Z) referenced in function main [C:\Users\morphogencc\Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj]
  TimeSeriesClassificationDataStreamExample.obj : error LNK2019: unresolved external symbol "public: double __cdecl GRT::Random::getRandomNumberUniform(double,double)" (?getRandom
NumberUniform@Random@GRT@@QEAANNN@Z) referenced in function main [C:\Users\morphogencc\Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj]
  C:\Users\morphogencc\Downloads\grt\build\tmp\Debug\TimeSeriesClassificationDataStreamExample.exe : fatal error LNK1120: 4 unresolved externals [C:\Users\morphogencc\
Downloads\grt\build\tmp\TimeSeriesClassificationDataStreamExample.vcxproj]

"C:\Users\morphogencc\Downloads\grt\build\tmp\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\morphogencc\Downloads\grt\build\tmp\UnlabelledDataExample.vcxproj" (default target) (92) ->
  UnlabelledDataExample.obj : error LNK2019: unresolved external symbol "public: __cdecl GRT::Random::Random(void)" (??0Random@GRT@@QEAA@XZ) referenced in function main [C:\Users\
morphogencc\Downloads\grt\build\tmp\UnlabelledDataExample.vcxproj]
  UnlabelledDataExample.obj : error LNK2019: unresolved external symbol "public: __cdecl GRT::Random::~Random(void)" (??1Random@GRT@@QEAA@XZ) referenced in function main [C:\Users
\morphogencc\Downloads\grt\build\tmp\UnlabelledDataExample.vcxproj]
  UnlabelledDataExample.obj : error LNK2019: unresolved external symbol "public: double __cdecl GRT::Random::getRandomNumberUniform(double,double)" (?getRandomNumberUniform@Random
@GRT@@QEAANNN@Z) referenced in function main [C:\Users\morphogencc\Downloads\grt\build\tmp\UnlabelledDataExample.vcxproj]
  C:\Users\morphogencc\Downloads\grt\build\tmp\Debug\UnlabelledDataExample.exe : fatal error LNK1120: 3 unresolved externals [C:\Users\morphogencc\Downloads\grt\build\
tmp\UnlabelledDataExample.vcxproj]

    12 Warning(s)
    197 Error(s)

Some examples are still able to build (most of the classifier examples, for example) while most of the unit tests fail to build.

This also produces a static lib that I can link against, but almost any program I write and link has runtime exceptions. For example, any classifier that I instantiate:

    DecisionTree dTree;
        AdaBoost aBoost;

causes a memory access violation exception:

Exception thrown at 0x00007FF91447F8A5 (grt.dll) in exampleClassification.exe: 0xC0000005: Access violation writing location 0x00000000001506CC.

I've tried both the master and dev branches of the GRT, and they both seem to have these errors.

Ehekatl commented 7 years ago

same issue here

morphogencc commented 7 years ago

I've figured out a short-term fix -- just include the entire GRT as source in Visual Studio and it'll compile. This means that you're not using the static lib, but at least you can compile and use it for now.