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
Cant compile the solution on Ubuntu #725
Comments
Going to tag @carlo-bramini since he's the only one who has compiled on Linux afaik. It's not officially supported yet but hopefully it will be soon. |
Actually, I'm using CYGWIN as development platform and I also have been not able to make working on it according to the instructions, although I got errors different from yours. However, on my Debian virtual machine, I have not cross compiled for MinGW, but I created a native POSIX executable for the build target. |
Well, I have also a PC with Windows 10 and the MSYS64 shell installed so if you have a script for compiling at all I am interested since I want to test some changes I made to the source, thank you in advance... |
if you want to do "not using the docker real compiler version" its pretty easy to get working in MSVC with Clang for VS installed. So you can build and dev native windows with a debugger if you want. The hard part is getting the 32bit libs for FFMPEG etc but if you now have a 64bit version building that is probably not an issue anymore. however to the original post. building with Docker on linux should be no different to building with Docker on Windows. running |
Building with docker on Windows for me is not possible in this machine as is a Windows 10 LTSC 2019 and in this version the Subsytem Layer is bugged so I cant install Ubuntu... Which leave the route of Clang for VS and compile on Visual Studio or if @carlo-bramini share his script so I can give a try on MinGW... |
or |
At this address, I created a branch in my fork with the scripts for CMake: https://github.com/carlo-bramini/Tomb1Main/tree/add-cmake-support You can clone it or you can just copy
Obviously, the parameter If you want a way for an easier debugging experience, you can configure CMake for generating the files for opening the engine with an IDE like code::blocks, VisualStudio, Codelite, Eclipse and others, by passing an option to the generator.
I hope that you will find it useful. NOTE: at the time of write, the engine may not be able to find the data files because the filesystem is case sensitive on linux, so don't forget to rename the file names to lower case before running. |
Looks like there's something wrong with SDL 2. |
I have installed libsdl2-dev on my system though. |
Oh it may be working but you need a newer version. What SDL 2 version do you have? |
version 2.0.10+dfsg1-3 |
I think you need at least 2.24 IIRC. |
I installed the latest SDL 2.26.2 but now I got the following errors: /usr/bin/ld: /usr/local/lib/libavformat.a(fifo.o): undefined reference to symbol 'pthread_join@@GLIBC_2.2.5' |
Hm probably another @carlo-bramini question. Seems like cmake isn't finding a library. |
Hi, I have installed tons of libraries: zlib, lzma and many more but after trying to compile I get the following error: /usr/bin/ld: /usr/local/lib/libavcodec.a(tiff.o): in function After searching for this specific error, many told me that I need to install the lzma dev libraries which I did yet I still got the same error, another person told me to add -lzma to the linker flags but I could not find where to set this flag... |
Where does this source came from?
It doesn't exist into the repository of the engine. |
It looks like it's required by ffmpeg. Some quick googling mentions installing |
I installed FFMPEG from source since installing from apt-get wasn't working, the makefile was unable to detect the FFMPEG libraries.
Yes I cleaned the build folder... |
There is really no way I can compile this source, I uninstalled the source compiled ffmpeg and installed ffmpeg via: sudo apt install ffmpeg and still the same error... I think the problem is that Cmake isnt adding the necessary linker flags because previously the compiler was complaining that it needed pthreads on so I added to CMakeLists.txt: set (THREADS_PREFER_PTHREAD_FLAG ON) |
Probably, this happens because you didn't configured CMake properly for searching your libraries in the right place, by setting |
Yes after setting the variable that you posted it isn't complaining anymore but I still got the lzma error I posted before :( I gave up on Ubuntu, I will try to install Debian on a virtual machine and try again... |
I did a new, clean installation of Debian 11 into a virtual machine.
Then, I typed this to clone my repo:
Next, I selected the branch with my scripts for CMake:
Finally, I created a space for configuring and compiling:
That's all. ATTENTION - ATTENTION - ATTENTION
Hopefully, this can be fixed in the way that I have written into issue #716 or by just commenting those lines if you want to bypass the error quickly. |
Ok thanks for all the patience, hopefully this time I will be able to compile, I will take into account the SDL suggestion... EDIT: I finally compiled the source, as you said, there were no surprises on Debian, it was really straightforward, no errors, no nothing... thank you for all the assistance BUT I though I was cross compiling a win32 exe XD Could you perhaps give me the command to compile a win32 exe EDIT2: I was able to compile a win32 exe on Debian using the instructions on the Contributions.MD file, there was no issue while running |
Happy to know that you built the engine successfully. |
Sadly no, while I could compile on Debian the repository you gave me the link when running the app on Ubuntu it just give errors about not finding the necessary files, although I put the data, fmv and music files and folders in the root folder of the app and all in lowercase... On Debian I didnt tryyet because the OS is running on VMWare and I installed only the minimum to compile the source... |
Hm glad you got something working at least. I'm not sure why it wouldn't work on Ubuntu though. Did you pull the latest |
I will also try on Ubuntu ASAP, to understand what it is happening. |
Nevermind your latest commit fixed it, I compiled the latest source but used the json file from a previous installation, after using the latest json I ran the game without any problems.
Thing is I am not very good at Tomb Raider, I am learning though, so I am only at the St Francis Folly level but didn't notice anything out of the ordinary... |
I was trying to compile on Ubuntu LTS 22.04 and got the errors I posted. |
I will also try Ubuntu LTS 22.04 ASAP. |
Upon further inspect I had Ubuntu 20.04.5 LTS codename Focal, sorry for the inconvenience |
This explains the errors into the screenshot that you attached to this thread. |
Taking a step back here, @Marcelo20XX what are you trying to accomplish? Officially we only support Windows as the target platform for now, and the only official toolchain is Docker which should let you compile from either Windows (via WSL) or Linux. People seem to be focusing on helping you build the game natively on Linux, but this will result in a Linux executable. Is this what you want? Anyhow the errors from the logs in your opening post are quite surprising and I'd focus on addressing these. @carlo-bramini going forwards I'd welcome a Dockerfile that does a fully static build for Linux. (It could use cmake underneath.) Distros change, packages get outdated and eventually removed and a Docker image would help us futureproof the build system a bit, the same way we've done with the Windows target. |
No, I originally wanted just to compile the solution for a windows executable, but then I got my first problem, having an installed Windows 10 LTSC without WSL support (due to Microsoft's bug in the version I had, solved on recent builds). Then I tried on Ubuntu 20.04.5 LTS which as per the instructions on the contribution.MD file was the OS that is used for the official way of building and got tons of errors which I posted, then thanks to a suggestion I installed Debian on a virtual machine, used Docker and all my issues disappeared, got the source compiled without any problems and finally got a window's exe for testing changes... In the end I could compile a Linux and a windows executable, tested the game on both OSes too thanks to @carlo-bramini scripts and detailed instructions... |
Great news! Better Linux compatibility is hopefully coming at some point. Is this issue good to close? |
The engine cannot be compiled with the old packages provided by Ubuntu 20.04.5, unfortunately there is nothing that can be done to bypass this limitation except doing a upgrade by either using |
Ok I will close the issue as solved because on the latest Ubuntu distro is working... |
I followed the instructions on the Contibutions.MD file. Installed docker, make package and the gcc-mingw-w64 package yet still I get the following error when entering the command on the terminal: sudo make debug
The text was updated successfully, but these errors were encountered: