projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 365 forks source link

Problems compiling ProjectM 4.1.1 #814

Open joonas-foo opened 4 weeks ago

joonas-foo commented 4 weeks ago

Please confirm the following points:

Topic

General Request

Your Request

Hi! I'm a novice Linux (Ubuntu-Gnome) user, I'm having problems compiling ProjectM 4.1.1. I used to have the Steam -version installed but wanted to try out compiling the new version which is being updated quite often! Hmm, I don't get errors compiling, I installed Bison and Flex earlier trying to compile the thing, Also tried Ninja if it would have had helped getting the compiling right! I've done the compiling like is said in 'BUILDING.md'. Or is it so that I just cannot locate the executable file, as the compiling reports no errors? I've tried looking for the file projectMSDL and been trying to look for an executable file with a different name. Here's the log of compiling the thing and also the directory structure of the compiled ProjectM.

projectm-directorystructure.txt projectm-compiling.txt

kblaschke commented 4 weeks ago

Two separate things here, one regarding your build process and the other is which repository you need.

Your build log:

I see you've executed the first CMake command via sudo. Because of this, the generated build dir is owned by root and your unprivileged user cannot write to it, thus the permission denied and subsequent build errors. As a rule of thumb, never ever call CMake or the build command like make as root. Not only this will mess up your permissions, but it poses a severe security risk since the build system executes commands, which could be used to hijack your OS.

To fix your build dir, delete it (might require sudo as well), then run all build commands with your normal use account.

Note about requiring Bison and Flex

These tools aren't required if you just want to build projectM. You only need them if you have changed the scanner/parser grammar for the expression language, e.g. the Scanner.l and Compiler.y files in projectm-eval. You can safely ignore the CMake warning. We'll silence this warning and replace it with a better message.

projectMSDL

The projectMSDL executable is built from a different repository. The projectm repository only contains the main projectm libraries, but no executables.

To build the SDL app, you need the libraries from this repo, plus the frontend-sdl2 repository and its additional dependencies (SDL2, Freetype and POCO). Please refer to the build instructions in the other repository on how to get the dependencies and build the program. Please be aware that the installation process of frontend-sdl2 is currently broken. I'm still working on it, hope to get it fixed until mid-June.

joonas-foo commented 4 weeks ago

Hi! I've tried doing the compiling like is said in 'BUILDING.md', I didn't use the sudo-command with the cmake compiler but I wanted to try it because I couldn't get the program working! At some point I was thinking that maybe this is just a lib-package, but didn't go as far as trying to find the frontend/executable source because it wasn't mentioned anywhere here on https://github.com/projectM-visualizer/projectm or 'BUILDING.md', I just didn't notice this! I think I'll get it working now, is it so the libsdl -package isn't even needed for using the visualizer if I get it right? I've liked the visualizer I downloaded before from Steam, excellent, thanks!

kblaschke commented 4 weeks ago

SDL isn't required for libprojectM, that's correct. The projectm repository still contains the old SDL app, but we just kept it as a quick testing tool for developers to have something to debug the library. The executable is not installed, it's just meant to be run directly from the build directory in a development environment.

The actual projectMSDL project (which is the frontend-sdl2 repository) requires SDL and a few other dependencies.

This way, we can keep the core library dependencies low.

You can also join our Discord server, where the team can help out with build issues more directly.