jdisset / gaga

GAGA is a fast, header only, multi-objective, and distributed evolutionary algorithm library written in modern C++. It is designed to be easily usable with various genotype representations and allows the user to enable or disable several features such as novelty search or speciation. It also produces and exports various customizable statistics.
MIT License
18 stars 4 forks source link

Building in MSVC2017 (Windows 10 x64): _mkdir #7

Closed DJuego closed 4 years ago

DJuego commented 5 years ago

Hi! Thank you for this apparenty excellent contribution! :-)

I work in Windows 10 x64 with Microsoft Visual Studio 2017 and I have a problem with the gaga compilation:

1>------ Build started: Project: prueba_gaga_msvc2017, Configuration: Release x64 ------
1>main.cpp
1>p:\mis-proyectos\personal\prueba_gaga\inc\gaga\gaga.hpp(1617): error C2065: '_mkdir': undeclared identifier
1>p:\mis-proyectos\personal\prueba_gaga\inc\gaga\gaga.hpp(1617): error C3861: '_mkdir': identifier not found
1>p:\mis-proyectos\personal\prueba_gaga\inc\gaga\gaga.hpp(1617): note: '_mkdir': function declaration must be available as none of the arguments depend on a template parameter

I have added to gaga.hpp the lines:

#ifdef _WIN32
#include<direct.h>
#else

#endif

It seems work. At least the code compiles.

Thank you again! DJuego

jdisset commented 4 years ago

GAGA is now "officially" a C++17 library, and all the file & directory operations have been handed over to std::filesystem. This should fix most of the portability issues as long as you have a recent enough compiler. I haven't had the occasion to test it on Windows but it should work. I'd appreciate if you can try again on your setup.

DJuego commented 4 years ago

Yes, I can confirm that it works! Thanks for taking a look at this.

DJuego