grt icon indicating copy to clipboard operation
grt copied to clipboard

Compile the GRT library in windows

Open khaledwaly opened this issue 8 years ago • 4 comments

While compiling ALL_BUILD.vcxproj, there are a large number of LNK2019 errors should i start with Visual Studio Linking Instructions before runing ALL_BUILD.vcxproj ?!

I was wondering if you have any suggestions on fixing this @nickgillian @Ehekatl @roastedchiken @morphogencc @pradeept12

khaledwaly avatar May 03 '17 12:05 khaledwaly

UPDATE: Actually I have neglected the errors in the ALL_BULD.vcxproj files and followed the Visual Studio Linking Instructions and was able to run the test code in the build page. Still wondering if these errors will have an effect later on

khaledwaly avatar May 03 '17 13:05 khaledwaly

I was able to get around this by just adding every .h and .cpp file to my project; it's not ideal (a .dll and .lib would be better for portability), but it works for now.

morphogencc avatar May 03 '17 15:05 morphogencc

I think these link errors are related to the unit tests and examples not GRT itself.

Following the build instructions I just successfully built GRT on Windows 10, VS 2015, but had many link errors of the form:

Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall GRT::ClassifierUnitTestHelper<class GRT::AdaBoost>::ClassifierUnitTestHelper<class GRT::AdaBoost>(void)" (_imp??0?$ClassifierUnitTestHelper@VAdaBoost@GRT@@@GRT@@QAE@XZ) referenced in function "private: virtual void __thiscall AdaBoost_TestDefaultConstructor_Test::TestBody(void)" (?TestBody@AdaBoost_TestDefaultConstructor_Test@@EAEXXZ) AdaBoostUnitTest C:\Users\Jamie Bullock\Documents\grt\build\tmp\AdaBoostUnitTest.obj 1

This, for example, relates to the AdaBoost unit test, not to grt.lib or grt.dll which were built successfully.

I suspect that the object files that are failing to link do not have grt itself added their respective linker settings.

jamiebullock avatar May 18 '17 10:05 jamiebullock

Further, you can disable tests / examples / tools with flags to make:

cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF ..

jamiebullock avatar May 18 '17 16:05 jamiebullock