Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during cmake --build . --target install ("JUCE requires c++17 or later") #749

Closed
lucreciaef opened this issue Dec 8, 2022 · 8 comments · Fixed by #750
Closed

Error during cmake --build . --target install ("JUCE requires c++17 or later") #749

lucreciaef opened this issue Dec 8, 2022 · 8 comments · Fixed by #750
Labels

Comments

@lucreciaef
Copy link

Hi! Long story short, I have an assignment in which we were asked to export a project from Projuicer to Visual Studio. I would like to use Clion instead, but that requires that I convert the .jucer file to .cmake

I'm using Windows10, so I installed WSL Ubuntu, got the whole thing running (after 3 hours of trial and error)
I installed all the dependencies I could, but when running
$ cmake --build . --target install
the console says "Building CXX object Jucer2Make......" and then after 5 lines it breaks saying
"91 | #error "JUCE requires C++17 or later"

I have the latest version of g++ and clang installed on the ubuntu vm. I installed g++-multilib too.

Do I need to add something additional to the build/target command ? I am learning C++ and I'm quite new to linux, so I apologize if this is a complete noob question. I've exhausted my options.

In the meantime I can continue working on Visual Studio but it's inconvenient once I'm already used to my Clion IDE :(

Thanks in advance to anyone who could give me a hint

@McMartin
Copy link
Owner

McMartin commented Dec 8, 2022

Hi @lucreciaef,

On Windows, you can use CLion with the MSVC toolchain that comes with Visual Studio. See https://www.jetbrains.com/help/clion/quick-tutorial-on-configuring-clion-on-windows.html#MSVC. You don't have to use WSL.

However, if you still want to use WSL, FRUT should work just fine. Could you please share the CMakeCache.txt file in a new comment? I'd like to see how FRUT was configured.

@cuanyu
Copy link

cuanyu commented Dec 9, 2022

I am having the same problem on my Ubuntu 20.04 machine too when I try build and install FRUT.

/home/tom/JUCE/modules/juce_core/system/juce_CompilerSupport.h:91:3: error: "JUCE requires C++17 or later"
#error "JUCE requires C++17 or later"

The JUCE itself could be correctly built stand alone. I am using gcc 9.4.0 and clang 10.0.0-4ubuntu1.

@lucreciaef
Copy link
Author

lucreciaef commented Dec 9, 2022

Hi @McMartin
Thank you very much for the quick reply.

I was fortunately able to make this work today! So I'll share what happened here for the record:
I initially tried with Ubuntu so that I could follow the exact installation instructions in the FRUT readme, which are linux commands. It doesn't work otherwise (or I'm not aware of how to do it). So, I wasn't able to create the CMakeLists.txt file myself - a colleague with a Linux machine generated it for me, and I pasted it into my project file and changed the folder paths.

I opened the project on CLion and got an error saying that it couldn't find the "reprojucer" file and that "C++17" was required. I went ahead and simply edited the CMakeLists.txt file... replaced C++14 with C++17 on " CXX_LANGUAGE_STANDARD "C++17"", and corrected the reprojucer.cmake location path, which was somehow wrong - CMake build worked. (?)
Then, when trying to run the project .exe I ran into another problem: fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj ...After reading many threads about what this is and what it means, I found a fix and added

if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()

in the CMakeLists.txt file ... And that finally worked and launched the program.

I removed these manual hacky fixes and changed the toolchain to Visual Studio (instead of MinGW-64) and I run into the same errors. So I put back those additions in the CMakeLists.txt file.


To sum up: I'm no longer blocked but I'd still like to see what went wrong with the Ubuntu vm. I'm sending the CMakeCache.txt from the /FRUIT/build folder.

CMakeCache.txt

@McMartin
Copy link
Owner

McMartin commented Dec 9, 2022

I see what is going on: JUCE requires C++17 since juce-framework/JUCE@b3a4d54, which was released in JUCE 7.0.3.
FRUT hasn't been updated yet to support JUCE 7.0.3. I'll take care of fixing that as soon as possible.

@McMartin
Copy link
Owner

McMartin commented Dec 9, 2022

I opened #750 to fix this issue. Feel free to give it a try and let me know if anything is not working as expected.

@lucreciaef
Copy link
Author

@McMartin I just tried again. Sadly it failed at 31%. Screenshot below:
image

I do have the package libx11-dev installed in its latest version. CMakeCache file below!
CMakeCache.txt

@McMartin
Copy link
Owner

McMartin commented Dec 9, 2022

@lucreciaef as documented in https://github.com/juce-framework/JUCE/blob/master/docs/Linux%20Dependencies.md, you also need the package libxrandr-dev (and a few other ones).

@lucreciaef
Copy link
Author

@McMartin Thanks for the hint. I thought I had them all but two were missing.
The build and install worked now. I got stuck with $ cmake .. -G<generator> but my guess is that I'm simply missing many other dependencies on this wsl ("Cmake was unable find ...."). So I'll get to reading more about this later :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants