diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index 49241690d..7a0d8ef6b 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -42,6 +42,10 @@ POSSIBILITY OF SUCH DAMAGE. #include +#ifdef TORRENT_WINDOWS +#include // for _getcwd +#endif + using namespace libtorrent; int load_file(std::string const& filename, std::vector& v, libtorrent::error_code& ec, int limit = 8000000) @@ -284,10 +288,11 @@ int main(int argc, char* argv[]) #endif { char cwd[TORRENT_MAX_PATH]; - getcwd(cwd, sizeof(cwd)); #ifdef TORRENT_WINDOWS + _getcwd(cwd, sizeof(cwd)); full_path = cwd + ("\\" + full_path); #else + getcwd(cwd, sizeof(cwd)); full_path = cwd + ("/" + full_path); #endif }