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

Doesn't build on Linux #15

Closed
ImplicitSaber opened this issue Apr 22, 2022 · 10 comments
Closed

Doesn't build on Linux #15

ImplicitSaber opened this issue Apr 22, 2022 · 10 comments

Comments

@ImplicitSaber
Copy link

I am trying to build this on Linux Mint 20.3 Una. I get this error when running CMake:

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMAKE library architecture: x86_64-linux-gnu
-- Target is 64 bits
CMake Error at CMakeLists.txt:55 (find_package):
  By not providing "FindSDL2_mixer.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "SDL2_mixer", but CMake did not find one.

  Could not find a package configuration file provided by "SDL2_mixer" with
  any of the following names:

    SDL2_mixerConfig.cmake
    sdl2_mixer-config.cmake

  Add the installation prefix of "SDL2_mixer" to CMAKE_PREFIX_PATH or set
  "SDL2_mixer_DIR" to a directory containing one of the above files.  If
  "SDL2_mixer" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/user/mc2/CMakeFiles/CMakeOutput.log".
See also "/home/user/mc2/CMakeFiles/CMakeError.log".

I am not a pro at building from source and do not know what any of this means. Could someone please help with this?

@GrArmpit
Copy link

Had that same error, got around it with this.
Basically clone this repo into mc2/cmake/sdl2, then add list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2) somewhere near the top of CMakeLists.txt in the root mc2 folder.

That got me all the way to building the data, but I error there with:

./makefst -f art.fst -p ../art/ -m data/art
make: ./makefst: Permission denied
make: *** [fst.mk:4: art.fst] Error 127

Don't really understand any of this myself, but I'm guessing I missed something important building the data tools. Will keep poking at this.

@GrArmpit
Copy link

Yep, I forgot to make after cmake ../, mildly important. Everything seems to work after that, very pleased to report.

@MoebiusTesla
Copy link

This is my first time building, could someone help me translate the windows build steps for windows to linux?
I would like for the maker to add the steps in the linux section, but it seems i can not contact him.

@GrArmpit
Copy link

Once you've got all the dependencies, first step is
git clone https://github.com/alariq/mc2
to download the repository. cd mc2 to enter it, then mkdir build.
Next up, we need to delete the /mc2/cmake/sdl2 directory then
git clone https://gitlab.com/aminosbh/sdl2-cmake-modules.git cmake/sdl2
rm -rf cmake/sdl2/.git
to bring in some extra tools that I think are supposed to take care of themselves but don't.
Once that is done, cd build and cmake ../ to prepare your build files, then make all BUILD_PLATFORM=linux.
Now you're going to want to cd back to the home directory, then git clone https://github.com/alariq/mc2srcdata then cd mc2srcdata/build_scripts. Before proceeding, grab text_tool from /mc2/out/text_tool/ and the four other applications in /mc2/out/data_tools/ (Should be listed in the Windows install) and copy them into the build_scripts folder. Now run make all BUILD_PLATFORM=linux again. Take all the new files in this folder and put them in your desired final install directory, along with /mc2/build/mc2, /mc2/build/out/res/libmc2res_64.so, and mc2/shaders. libmc2res_64.so seems to need to be renamed to libmc2res.so. Once all that is done, you should be able to run mc2.
Hope this helps!

@MoebiusTesla
Copy link

Thanks that worked!
mc2 is running but the sounds is crackling and can not seem to load the campain, hangs endless on loading screen with no progress bar.

@GrArmpit
Copy link

GrArmpit commented Sep 17, 2022

Haven't had issues with the sound, so I'm not sure about that one.
As for the infinite loading, when running through the terminal it complained about missing water textures. I believe there were some extra texture files in the mc2srcdata that you can put into the game directory that might help

@MoebiusTesla
Copy link

MoebiusTesla commented Sep 17, 2022

Yes it says it is missing: MechCommander 2 could not open the file data/textures/mc2_01.water0016.tga
Unfortunately i can not seem to find this tga file in the source data.

@GrArmpit
Copy link

I was able to get around the water problem by following this alariq/mc2srcdata#1 (comment) and rebuilding mc2 and libmc2res.so
I haven't been able to get around the mentioned burnin texture using the following posts' fix though, maybe you'll have more luck

@MoebiusTesla
Copy link

That worked, game is running, although the models of the mechs and enemies are doubled it is playable now

@alariq
Copy link
Owner

alariq commented Oct 8, 2022

@MoebiusTesla Sorry for the delayed reply. They are doubled because I have 2 different draw paths in the code (one is in the test and it is easier this way for me to test stuff). It should be easy to disable it.
I do not have much time recently to update the code due to the war, I might look there if it will be in high demand which I doubt though :)

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

No branches or pull requests

4 participants