drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.44k stars 1.1k forks source link

Unable to make Drogon on Windows #1737

Closed albaropereyra22 closed 1 year ago

albaropereyra22 commented 1 year ago

This is probably a dum issues but, I am unable to make Drogon on windows. cmake .. works but make doesn't. I get the generic error: make: *** No targets specified and no makefile found. Stop.

To Reproduce I follow the steps here: https://github.com/drogonframework/drogon/wiki/ENG-03-Quick-Start to no avail.

Expected behavior I exepect the project to be built by make.

Screenshots image

Desktop (please complete the following information):

VladlenPopolitov commented 1 year ago

@albaropereyra22 You should not run "make" (it is only in Linux and Mac Os). CMAKE created projects files for you, you can open solution file in MSVC and build library as usual program.

If you do not need to work with Drogon source code, but only need to use it as library, you can install drogon by package manager. Currently I see, that only vcpkg build correct library. Documentation recommend to use conan, but now conan is broken, it builds PostgreSQL library, that does not linked to drogon. Use vcpkg, it work OK. Pay attention, that conan and vcpkg conflict each other. If you do not depend on conan in other projects, it is better to completely delete it and reinstall everything in vcpkg.

albaropereyra22 commented 1 year ago

@VladlenPopolitov are you aware of a command I can run on windows to build it? I have Drogon installed via vcpkg I am over that hurdle. Thanks 😀

VladlenPopolitov commented 1 year ago

@albaropereyra22 I see, you have run cmake .. for you project in "new folder". You can check "build" folder, it contains YouSolutionName.sln file for solution and *.vcxproj file for every project in this solution. I usually run MS Visual Studio (you created project for VS 17 2022) , in menu file choose File->Open->Solution or project - and choose you solution from build folder. Then manually build Debug and Release version. All exe files will be built in the folder build/Debug and build/Release respectively. To run you program you need dll files of drogon, postgres, jsoncpp. I usually copy them from vcpkg/installed/x64-windows/bin to build/Release, from vcpkg/installed/x64-windows/debug/bin/ to build/Debug. I found, if release version of libraries used in debug version of program, unexpected errors appears, especially in jsoncpp.dll (when you use drogon config file). Once you prepare everything, then all will work smoothly, believe me.

The second way to build project - use cmake parameters (for new version of cmake), but I usually do not use it. Syntax like cmake --build . --parallel --target install It is build service from latest versions of cmake, replacement of make and MSBuild - if you need to build everything from command line. As I understand , you need to specify debug or release option - I cannot help, I do not use this way of build.

The third way - to run MSBuild.exe - it has parameters - solution name and build type - debug or release. I also do not use it now. You can look docs for it in Microsoft site.

albaropereyra22 commented 1 year ago

@VladlenPopolitov I was able to figure it out and run it on Windows. Thanks for your help. IMG_20230822_061249_480

VladlenPopolitov commented 1 year ago

Nice. If you meet some strange behaviour, it is highly likely wrong DLL in PATH. Sometimes build process copies Release version to Debug exe folder, and program crash. It is not Drogon problem. You can go documentation step by step, it is clear description.

drizzle042 commented 1 year ago

This should be closed as complete then.