Closed parvpareek closed 5 years ago
Hi @parvpareek,
Thanks for posting the error message. I don't have a Visual Studio setup myself, unfortunately, so it is very helpful.
We recently changed the CMake generator to Ninja. It looks like Visual Studio is complaining about this:
CMake Error: Error: generator : Ninja
Does not match the generator used previously
The error message suggests a solution:
Either remove the CMakeCache.txt file and
CMakeFiles directory or choose a different
binary directory.
Does Visual Studio provide a way to clear the CMake cache? That may be the easiest path forward. If so, please try it, re-run CMake, and post the output.
You could also try to find and manually remove:
CMakeCache.txt
CMakeFiles
and then run CMake again.There may be a second error related to finding Boost libraries, but we should probably fix the generator issue first.
Yes. I did manually remove cmakecache as suggested by the compiler. I even downloaded the folder once again but it still didnt work. I have already spent more than 7 hours trying to solve it
I had opened another issue in which I have mentioned everything in detail. https://github.com/exercism/cli/issues/839 Please check it out.
Hi @parvpareek ,
Will do.
I looked more closely at the CMake generator changes that I mentioned previously - I don't think they can have an effect on your system. There's likely something else going on.
@parvpareek Unfortunately you're hitting two known issues, both of which we're working on fixing.
With a non-boost exercise all you need to do is:
I tested that just now.
Thanks. That will be so easy. I can wait for 1 month. I am learning OpenGL for now. I don't, know what I would have done if it were not for this issue.
Hi @parvpareek, more than half of the exercises are now in this new format, so feel free to start working on them. #253 lists all the exercises with the new versions that will work for you. The unchanged exercises are all later in the track, so unless you work very quickly you won't get to them until I port those over next weekend :)
I am still working on updating the documentation, but my description above should be able to get you started. Please let me know if you have issues using that.
@patricksjackson I still don't understand. How am I supposed to compile it?
Cant build.
Cant compile. Does it have something to do with this- ?
That's a boost error, you need to update to the latest version of the exercise.
The newly downloaded problem should be the new version without Boost (the hello_world_test.cpp file will have #include "test/catch.hpp"
at the top.
I tried downloading the newer version thrice and it still includes boost. What is up? .
Hi @parvpareek , you're right - that's still the Boost file.
Patrick's instructions look accurate. Two thoughts:
Either of these could prevent the new test file from being downloaded properly.
I had a similar error. My CMakeList.txt looks like
cmake_minimum_required(VERSION 3.24)
project(your_target_name)
set(CMAKE_CXX_STANDARD 20)
add_executable(your_target_name main.cpp)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG 0817715923c9705e68994eb52ef9df3f6845beba)
FetchContent_MakeAvailable(cpr)
target_link_libraries(your_target_name PRIVATE cpr::cpr)
And the problem was that when I created a project in CLion, it set up a CMake profile like this screen
Then I ran cmake generation and everything worked fine, but after restarting ide i got this:
CMake Error: Error: generator : MinGW Makefiles Does not match the generator used previously: Ninja
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
So the solution was to recreate the project with the Ninja generator initially set in the CMake profile settings like this screen
I resolved it by looking for all the CMake (folders) and files (including the CMakeCache) and removed them. After that I ran it again and it worked
I opened hello-world folder using visual studio's cmake in File>Open>Cmake. In the terminal i wrote -`
` It showed an error in the ide which was as follows -
Severity Code Description Project File Line Suppression State Error CMake Error: Error: generator : Ninja Does not match the generator used previously: Visual Studio 15 2017 Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory. c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\commonextensions\microsoft\cmake\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\Avi-parv\CMakeBuilds\54b55018-480c-1b33-a81d-1f236c8d7337\install\x64-Debug (default)" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="c:\program files (x86)\microsoft visualstudio\2017\professional\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe" "C:\Users\Avi-parv\Exercism\cpp\hello-world" returned with exit code: 1 CMake Error: Error: generator : Ninja Does not match the generator used previously: Visual Studio 15 2017 Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory. C:\Users\Avi-parv\Exercism\cpp\hello-world\Does not match the generator used previously
In the terminal this error was shown -
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2044 (message): Unable to find the requested Boost libraries.
Boost version: 1.66.0
Boost include path: C:/lib/boost_1_66_0
Could not find the following static Boost libraries:
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost. Call Stack (most recent call first): CMakeLists.txt:14 (find_package)
-- Configuring incomplete, errors occurred! See also "C:/Users/Avi-parv/Exercism/cpp/hello-world/CMakeFiles/CMakeOutput.log".
C:\Users\Avi-parv\Exercism\cpp\hello-world>C:\lib\boost_1_66_0 'C:\lib\boost_1_66_0' is not recognized as an internal or external command, operable program or batch file.
Someone please help