3

This is the link that Matt Godbolt posted on reddit a year ago or so: a multifile project compliled by his Compiler Explorer.

Clearly, as soon as I change the compiler to MSVC, the building fails; not just because of the options (e.g. -std=c++17 should be /std:c++17), but mainly because of the makefile.

How do I need to alter the project to make it compile with MSVC?

Enlico
  • 23,259
  • 6
  • 48
  • 102
  • As I know, make requires POSIX, I assume it is not Installed on the msvc servers. Try to use cmake instead. – Fabian Keßler Oct 25 '22 at 17:02
  • @FabianKeßler, the example I linked does use cmake. – Enlico Oct 25 '22 at 17:04
  • Then tell cmake to generate a VS Solution. – sweenish Oct 25 '22 at 17:04
  • 1
    @sweenish, I've tried replicating the first, small, one-file, example [here](https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/), but [it looks like Compiler Explorer is interpreting `CMakeLists.txt` as it was a C++ TU](https://godbolt.org/z/Kfxfbjv8a). – Enlico Oct 25 '22 at 17:32
  • 2
    I found this comment in [github](https://github.com/compiler-explorer/compiler-explorer/discussions/2763#discussioncomment-1393814). It seems that it still applies for now.. – Louis Go Oct 26 '22 at 01:26
  • And [this](https://github.com/compiler-explorer/compiler-explorer/issues/3216#issuecomment-1002099027) for more details. – Louis Go Oct 26 '22 at 01:28

0 Answers0