From 73c42d4574e5b7baeca609884be0561757d3fe15 Mon Sep 17 00:00:00 2001 From: giuliohome Date: Wed, 27 Aug 2014 23:21:55 +0200 Subject: [PATCH 1/2] FIX: If you are using Windows, __declspec(dllexport) is necessary --- windows/README.md | 6 +++++- .../{xgboost => }/xgboost_wrapper/xgboost_wrapper.vcxproj | 0 wrapper/xgboost_wrapper.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) rename windows/{xgboost => }/xgboost_wrapper/xgboost_wrapper.vcxproj (100%) diff --git a/windows/README.md b/windows/README.md index b400b0c14..a8203165e 100644 --- a/windows/README.md +++ b/windows/README.md @@ -1 +1,5 @@ -This is a test for minimal files needed for windows version \ No newline at end of file +The solution has been created with Visual Studio Express 2013. +Make sure to compile the Release version, unless you need to debug the code +(and in the case modify the path in xgboost.py from release to test). +Note that you have two projects in one solution and they need to be compiled to use the standalone executable from the command line +or the python module respectively. \ No newline at end of file diff --git a/windows/xgboost/xgboost_wrapper/xgboost_wrapper.vcxproj b/windows/xgboost_wrapper/xgboost_wrapper.vcxproj similarity index 100% rename from windows/xgboost/xgboost_wrapper/xgboost_wrapper.vcxproj rename to windows/xgboost_wrapper/xgboost_wrapper.vcxproj diff --git a/wrapper/xgboost_wrapper.h b/wrapper/xgboost_wrapper.h index 04c1763c2..7d98b5208 100644 --- a/wrapper/xgboost_wrapper.h +++ b/wrapper/xgboost_wrapper.h @@ -7,7 +7,11 @@ * can be used to create wrapper of other languages */ #include +#ifdef _MSC_VER +#define XGB_DLL __declspec(dllexport) +#else #define XGB_DLL +#endif // manually define unsign long typedef unsigned long bst_ulong; From f3136c2d92dd352abbf4cc149530b2e605f71632 Mon Sep 17 00:00:00 2001 From: giuliohome Date: Wed, 27 Aug 2014 23:24:57 +0200 Subject: [PATCH 2/2] README --- windows/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/README.md b/windows/README.md index a8203165e..33d11f0c4 100644 --- a/windows/README.md +++ b/windows/README.md @@ -1,5 +1,5 @@ The solution has been created with Visual Studio Express 2013. Make sure to compile the Release version, unless you need to debug the code -(and in the case modify the path in xgboost.py from release to test). +(and in the latter case modify the path in xgboost.py from release to test). Note that you have two projects in one solution and they need to be compiled to use the standalone executable from the command line or the python module respectively. \ No newline at end of file