Mormert / jle

Jet-Lagged Engine is a work-in-progress C++/Lua game engine supporting Windows, Linux, Mac and browsers.
GNU General Public License v3.0
276 stars 18 forks source link

Build issues (might just be me) #21

Open Fahersto opened 5 months ago

Fahersto commented 5 months ago

Hey, After watching your showcase on youtube I tried to build you engine by following the README but there does not appear to be a CMakeList file at the top level. Is this expected? Maybe I just understood your intructions wrong?

Mormert commented 5 months ago

Hi, thanks for your interest!

There is a game template which contains the boilerplate code (including CMakeLists.txt) but with no game assets or game logic, just to get started, here: https://github.com/Mormert/jle/tree/master/gametemplate Each game that is made, you just copy that folder and adapt it to your needs. It expects the engine folder to be next to it, btw.

If you are interested in a "test project", (WARNING: currently running an outdated version of the engine), you can check this repo out: https://github.com/Mormert/cgfx

I'd like to ask you also, would you be interested in a simple "demo game" with the engine? Something to just get started with perhaps. Currently there is no such thing, just that repo I provided above (and of course the main game that I am working on, but that is not shared publicly).

Fahersto commented 5 months ago

Thank you for your reply. With the information you provided I attempted several ways to build the engine:

Ubuntu terminal:

image

Ubuntu VS Code

Windows VS Code and Visual Studio 2022 I run into compile errors with glad. I suspect my environment might be the issue. Sometimes having packages such as glad also installed via vcpkg seems to mess things up.

I also had the same issues when attempting to build cgfx.

Regarding your question about a demo game I believe this would be very nice to have. However, I myself am mostly interested about the feel of using your engine and the technical side of it. I'm currently working on my own engine so my I'm set on attempting to ship a game in my engine :smile:

Mormert commented 5 months ago

Regarding building on various platforms, as the engine is in constant development, not all platforms are always compiling, and a fast way to check which platforms are currently building is to check the build status in the README here: https://github.com/Mormert/jle?tab=readme-ov-file#build-status

You can also view details of builds here: https://github.com/Mormert/jle/actions

As can be seen, currently, Windows and MacOS are building succesfully in tests (but not Linux!)

Thus, I recommend if you want to test the bleeding edge version of the engine, to do so on Windows (as that is what the engine is being developed on). I think you have GLAD installed via vcpkg is causing issues, make sure to disable vcpkg.

Building on Windows, you can do with CMake as well, running (basically what you did on Ubuntu)

cmake .. -DJLE_BUILD_EDITOR=ON -DCMAKE_BUILD_TYPE=Release cmake --build .

You may need to specifically say to CMake that you want to use Visual Studio compiler (we don't support MinGW on Windows), do that by:

Run CMake to configure the project. Replace with the appropriate generator string for your installed version of Visual Studio. Here are some examples: For Visual Studio 2019: "Visual Studio 16 2019" For Visual Studio 2022: "Visual Studio 17 2022"

Then instead run:

cmake .. -G "" -DJLE_BUILD_EDITOR=ON -DCMAKE_BUILD_TYPE=Release cmake --build .

I also noticed you tried VS Code. I can recommend CLion as that is what Jet-Lagged Engine is being developed with, and works on all OSes, including Windows.

HardlineStudios commented 2 weeks ago

Same issues with building on Windows here as well. Followed instructions to fetch the repository into a directory (./jle).

These instructions are a little ambiguous as it suggests running these commands from the root JLE directory but that won't work and you'll get an error saying complaining it can't find a CMakeLists.txt in the root JLE directory.

mkdir build cd build cmake .. -DJLE_BUILD_EDITOR=ON -DCMAKE_BUILD_TYPE=Release cmake --build .

It does work if you do this in the engine directory though and I was able to generate an .sln file which I was able to open and build with in VS 2022 Community. This however led to multiple issues:

Firstly, you need to set the project to build using C++ 17 or 20 standards. By default it's set to 14. This clears up lots of issues but not all.

Secondly, a slew of build errors when building the engine project: Inside RmlUi_Platform_GLFW.cpp, I get three C2065: 'JLE_BUILD_OPENGLES30_RUNTIME': undeclared identifier errors which seems to stem from JLE_BUILD_RUNTIME_CONFIGURABLE being defined. If I undefine that, it then results in this error: RmlUi_Renderer_GL3.cpp(75,9): error C2059: syntax error: ')'

and it traces back to this macro: JLE_EXEC_IF(compileFlag) if constexpr (compileFlag)

I also see a slew of invalid integer constant expression errors throughout the build.

Any ideas here?

Thanks!

Mormert commented 2 weeks ago

@HardlineStudios , You can confirm that the gametemplate works and compiles fine, as seen in the auto-builds on GitHub: https://github.com/Mormert/jle/actions

Make sure to be in the "jle/gametemplate" folder (or your own game's main folder, but that gametemplate one is used to confirm that at least a basic empty game+engine builds correctly) when you run this:

_mkdir build cd build cmake .. -DJLE_BUILD_EDITOR=ON -DCMAKE_BUILDTYPE=Release cmake --build .

That will build the game (gametemplate) and the engine, in editor mode, so you can make game levels, add game logic scripts, etc etc

I suggest using CLion as your IDE (excellent integration with CMake), and you will not have to deal with setting up a VS .sln project, as that is usually not how you work with CMake anyway.

HardlineStudios commented 2 weeks ago

Yeah no luck. Thanks anyways.