snu-sf-class / swpp202401

Principles and Practices of Software Development Main Repository
13 stars 4 forks source link

과제2 cmake 관련 질문 #16

Open kimhaneal11 opened 5 months ago

kimhaneal11 commented 5 months ago

안녕하세요. 과제2를 하던 중 configure에 어려움을 겪고 있어서 질문드립니다.

vscode로 서버에 접속하여 사용하고 있고 랩 수업자료 중 'using cmake w/ vscode'를 참고하여 /opt/의 cmake로 주소를 설정해두었습니다. 이 상태에서 터미널에 cmake -G Ninja -B build를 입력했을때

CMake Error in interface/CMakeLists.txt:
  The target named "maybe_something.mod" has C++ sources that may use
  modules, but the compiler does not provide a way to discover the import
  graph dependencies.  See the cmake-cxxmodules(7) manual for details.  Use
  the CMAKE_CXX_SCAN_FOR_MODULES variable to enable or disable scanning.

이와 같은 에러가 interface 안의 세 .cppm에 대해 발생하는데 혹시 원인을 알 수 있을까요? 지금까지의 과정에서 제가 잘못 이해한 부분이 있는지 알고 싶습니다.

감사합니다.

strikef commented 5 months ago

If you don't explicitly specify the compiler, cmake defaults to using the system-default compiler, which is g++ in the development server. g++ 11.4 does not support exporting module dyndep analysis, so you should use clang++ instead. Try compiling assn2 with build-and-test.sh and see if it works.