-
Notifications
You must be signed in to change notification settings - Fork 16
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
Problems with building( Cmake and Sdl2) #136
Comments
Hi, The README and wiki are horribly out of date, as I haven't worked on this in a while (though I have recently restarted to project in a modular form, called OpenHill that'll support both SH2 and SH3. The Engine's a shared library that can be used by either game for more common stuff like lighting, but I digress). It's currently a private repository, but I can make it public if you'd like to help work on it. If you at #132, and look at the files changed, you should be able to get it to build on Windows. Both @z33ky and myself both developed this on Linux, so Windows was a bit of an afterthought. Let me know if I you need anymore assistance. Cheers, |
OpenHill sounds like an interesting project. I'd love to take a look at it and see if I can help out. I'm also going to try looking at #132. Thanks for the help! |
Still no luck. I tried making the build.bat file from issue #132 and the sdl.cmake file,but I still ran into problems: CMake Error at platform/win32/cmake/FindSDL2.cmake:188 (include): C:/Users/Austin/Desktop/sh3/sh3redux/platform/win32/cmake/FindPackageHandleStandardArgs.cmake Could NOT find SDL (missing: SDL_LIBRARY) (found version "2.0.9") CMake Error at tests/CMakeLists.txt:15 (include_directories): CMake Error at tests/CMakeLists.txt:16 (include_directories): |
Do you use a package-manager like MinGW or Cygwin, did you download pre-build libraries or did you compile the libraries yourself from source? |
I tried just downloading the libraries manually, building them using cmake, and then manually linking the include directories and libraries using the cmake GUI. Would you recommend using Cygwin or MinGW? Also after messing around with the cmakelists, I was able to get a visual studio solution as output from cmake,but I was unable to build the solution. |
Same as @Quaker762, I use Linux. I just wanted to get a clearer picture of your setup. In theory, after building the libraries you should just be able to set the directories/files for each library in cmake-gui and you should be good to go. Like with the error above, where it complains about missing SDL_LIBRARY, you should just be able to set that variable to the path of your SDL2.dll and it should proceed from there. Can you post your changes to the CMakeLists.txt? Even if you just hard-coded some paths, we should be able to improve our scripts based on the changes you needed to make. |
All I did was comment out a few lines of code in the tests/cmakelists.txt: and source/cmakelists.txt: I'm thinking I also don't have the libraries set up correctly. I have pretty strong familiarity with Linux, what are the steps you would take for installing the libraries and I'll see if i can figure out how to do that in Windows. |
Yeah, the directives you've commented out are needed. SDL2 should build a corresponding CMake script (see https://hg.libsdl.org/SDL/file/6a5107360fbc/CMakeLists.txt#l1820), which obsolete the Find*.cmake script as far as I understand. If you set I think the OpenGL-headers are somewhere in the MSVC folder. Do a file-search for "gl.h" in there. |
Also try replacing |
That makes it so that I can get through Cmake, but I'm still having 145 errors in the visual studio solution. |
Are they related to SDL2? It might need |
Sdl2 seems fine, the problem seems to be with zlib using unistd.h which doesn't exist on windows, and API Entry is undefined which I think is an OpenGL problem. |
Try replacing EDIT: |
I used something called "GNUWin32" which I read was a zlib library for Windows,but that might be causing the problems. |
Yeah, that likely used something like MinGW, which provides a unistd.h. As I said before, using something like MinGW or Cygwin (I think the former is more popular) is probably easier, but still I appreciate you trying and sticking with it so far :) |
Yeah, part of me actually finds this fun. I'm going to try doing it from scratch one more time, and then I'll try switching to MinGW or Cygwin. Thanks for all the help. |
Note that zlib provides MSVC-project files in contrib/vstudio. |
Do you know how to use OpenGL through Cygwin? There's a package for everything else but that. |
@mrhatkat If I remember correctly, the OpenGL lib should be part of Windows? You should be able to link with By the way, @z33ky, I've created another repo here https://github.com/Palm-Studios/OpenHill. This time the engine is a shared library ( |
Iirc Cygwin requires a X11 server for graphical applications, so if you can install xorg-server or something similar, that might come with the OpenGL library. |
Sorry to say, but I'm giving up on this for now. I can't get it to work in Cygwin because the GLEW libraries mysteriously vanish after installing them, and I don't know what to do with MinGW. Maybe I'll try to boot up Ubuntu and see if I can get it to work there. Thanks for all the help though! |
@mrkathat Just install MinGW to your C drive, then add the bin/ folder to your path. MinGW is just a build of gcc for windows. Then gather the appropriate gcc libs for windows and you should be good. Failing that, Linux will just work out of the box. |
Ah man, I am having the worst luck with this. I keep trying to use the MinGW Makefiles generator in cmake but it keeps giving me the error:
|
I managed to finally get it close to working on Linux, I end up with 5 shared libraries( cam,input,sh3rd,tex,and vao),but where is the executable? Is there another step I'm missing? To clarify, I used cmake then I used make on the root directory,source directory,and tests directory. |
That is very strange. You are using
These are test executables that can be run. For example:
Will run the texture render test application. We didn't actually get into any engine dev besides formats, but I'm going to lay out a roadmap using the kanban(?) cards on this repo so that we can actually some work done, instead of sporadically implementing formats and features (the main reason for this was us having to reverse engineer a lot of stuff, thankfully there's someone that's done a lot of this for us already). If you're comfortable enough to start making changes, however, go right ahead on your fork :) |
Hi @mrhatkat, I've been working on getting a Windows build system working for you, and I've had somewhat of a breakthrough. If you go to my fork of the repo here: https://github.com/Quaker762/sh3redux/tree/build_sys you should be able to build all the dependencies by running build.bat. I've switched over to using Let me know if this doesn't work for you, I've got it working on my machine. You can also, optionally edit |
No such luck. I had to change line 25 of the batch file to cd ../../../ in order for it to find the premake5.lua file, but I still get a ton of errors. Here's a pastebin of the output: https://pastebin.com/1RDF8RNs . Also, I think it might be trying to build in 64 bit instead of 32 bit. I'm going to attempt using vcpkg and cmake, since I think my MinGw install is bugged. If that doesn't work, I'll try clean installing MinGW. Thanks for the help. |
This definitely seems like it is the case, I have no clue why this would be happening, though Lord of Compilers, professor @z33ky might have some idea (hahaha). I'll upload the installer I used to install my version of
Install it to the root directory (i.e C:).
This should then work for you. If not, I'll have another look into it. Are you running Windows 10? |
Hi everyone,
I've been having problems with building the game engine. I tried following the steps on the wiki and the README but couldn't find the proper files like build.bat. I was able to get everything but sdl2 to work in cmake by adding the locations of the config.cmake for every library,but for some reason I can't get this approach to work for sdl2. I am on a windows machine running Windows 10 and had to install glew,zlib,boost,glm,and freetype2 to get this far. Is there an easier way to build this that I am missing or is something else wrong?
The text was updated successfully, but these errors were encountered: