0

I apologise for any inaccurate language - I'm very new to writing in c++ and using cmake

I'm using the cmake gui to do the generation. My generator is MinGW. The generation goes fine but when I try to run mingw32-make in the build directory (in terminal) I get the error message shown below:

anamorph_video_commandline.cpp:6:22: fatal error: filesystem: No such file or directory
 #include <filesystem>
                      ^

This is what my CMakeLists.txt looks like:


cmake_minimum_required(VERSION 3.26.0)
project(anamorph_movie)

# Set the C++ standard to C++17
set(CMAKE_CXX_STANDARD 17)


# include the vcg library
include_directories(./lib/vcglib-main/)
# include the eigen library
include_directories(./lib/vcglib-main/eigenlib)


# Add your executable and source files here
add_executable(${PROJECT_NAME} anamorph_video_commandline.cpp)
target_link_libraries(${PROJECT_NAME} stdc++fs)

I've tried using <experimental/filesystem> in my .cpp and get the same error message except it says

anamorph_video_commandline.cpp:6:22: fatal error: filesystem: No such file or directory
 #include <experimental/filesystem>

MinGW and cmake were both installed a couple days ago so I think its unlikely that its to do with the version.

As you can see from my CMakeLists.txt I also tried using: target_link_libraries(${PROJECT_NAME} stdc++fs) per the recommendation of something I found online, also no luck.

HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207
Cosmo
  • 1
  • 2
  • what do you mean by "My generator is MinGW"? – Sergey Kolesnik Feb 26 '23 at 23:31
  • 1
    There isn't a single thing called "mingw". It's possible that you've installed a version of it without `` support. Uninstall it and reinstall from [MSYS2](https://stackoverflow.com/q/30069830/2752075), that's probably the best MinGW version out there as of now. – HolyBlackCat Feb 26 '23 at 23:33
  • When specifying the generator for the project using the gui I select MinGW Makefiles. In cmd it looks like `cmake .. -G "MinGW Makefiles"`. I also suspected that I installed a version without support. I'll try following the stuff from the link and report back. – Cosmo Feb 26 '23 at 23:38
  • Report - installed msys following the advice in these links: https://www.msys2.org https://stackoverflow.com/questions/70197831/unable-to-determine-what-cmake-generator-to-use-vs-code-windows-10/74240235#74240235 I'm now running into a problem where when I try to run the command `mingw32-make` in the build folder I get a command not found error. My environment variable is set to the correct path I'm pretty sure: `C:\msys64\mingw64\bin` – Cosmo Feb 27 '23 at 00:03
  • Which make executable is there in mingw64/bin folder? – kiner_shah Feb 27 '23 at 07:10

0 Answers0