-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[build] Compilation issues under linux #332
Comments
I think the .so on Linux is broke. I'm trying to figure out what it might be. I think it might have something to do with adding a So far this is what I get if I try to make the examples with a shared library:
Any ideas? |
I think libraylib.so and libglfw.so.3 both install to /usr/local/lib which isn't in ubuntu's default library search path, but it's not hard to set up: https://ubuntuforums.org/showthread.php?t=420008 |
Hi @define-private-public! As @tmerr commented it's mainly a path issue... just added some additional checks to makefile (9272966). About GLFW, right version should be 3 but I thinks that's a Linux distribution dependant issue... About Some parts of the library have been redesigned in raylib 1.8 for better consistency and PBR materials support. Here it is more info on new features. |
When I get home I'll take a look at these things. Thinking about the As a side note, might I propose a slightly better branch system:
|
About branch system, I feel confortable with current one. Actually, |
Shared and static versions of glfw have different names no matter where you get them. -lglfw for shared, as per typical distro package installation and -lglfw3 for the static version generated by default when building glfw as per raysan's instructions on the wiki. BTW, Xenial's stock GLFW 3.1.2 IS horribly out of date. |
I guess editing the Makefile to suit a particular case is the way to go. |
Well I found something interesting in the I'm going to go report this to the GLFW devs and see what they think. EDIT: |
As far as I know, @raysan5 mostly develops on Windows and is rightfully leery of any particular build system on Linux. There are so many tools and systems, it's very distracting to a beginner just looking for exposure to video game programming. In the Linux world, the expectation seems to be that, as developers, it's on us to know where our towels are, so to speak. If you have a handle on make, gcc, and cpp, you are doing well. I'm not sure what your level is, but I had these same issues a few months ago and learned a lot researching them. |
@define-private-public Are you interested in Cmake support for raylib? We might be able to simplify some of the Linux specific logic in the makefiles as well as add handling for library types or other #defines such as CC, DEBUG, and RELEASE. It's important, for me at least, to remember that distributing raylib is somewhat different than distributing a game made with it. Truthfully, I don't know much about Cmake or any other Linux build system. At one time, @raysan5 mentioned premake, which is cross-platform with Windows. That might make his job as little easier, stuck between a rock and a hard place as he is. Anyway, I'm interested in your ideas and if I can help, I will. |
I can understand where he's coming from. It's a mess sometimes trying to figure out what to use and what not to use. The only thing that I can think of that might simplify these issues is to try switching the build system to CMake instead hand written Makefiles. GLFW has CMake support (and they use it too), so that dependency would be easily covered. CMake would also help ensuring that targets will build and run correctly on their systems. It might be worth a shot to try. |
Well, maybe we should identify a couple of initial targets to implement. @raysan5 likes to keep dependencies down and I think there may be times when we want raylib, GLFW, and whatever else one might want to add, built in to the distributable. I know it's not the Unix way, but it does effectively extend the range and stability of a particular product. For example, the Steam runtime exists for this purpose. Just compile against it with the Source SDK and those libraries are guaranteed to exist when you distribute through Steam. Anyway, we could start with mirroring what happens now. When that works, add in handling of shared libraries, install locations and distro variables. Coming up with a nice template for developing games is another thing to think about. Game-specific makefiles, etc Just so you know, I'm starting at square one with Cmake and am more than willing to just test anything you make. (^; |
How are you editing and managing files? We don't have anything like the Windows notepad project. I've been using Geany. Providing a pre-configured project is a side goal. |
(neo)vim, command line git, bash, & your standard linux/unix utils; I'm just that hardcore. I'm not too familiar with CMake or how to work it properly, but I've used it a few times. It's a pretty solid build system. |
Reporting in that the Before anything else it touched, I think it would be a good idea to hear back from the GLFW folks about that dropped |
Hi @define-private-public and @RDR8, just my two cents on this issue. About About raylib building, one of the goals of raylib is keeping things as simple and possible for the user, I prepared the library to be as easy to setup and start coding games (at least on Windows), it is great for my students. But I understand that now the scope of the library is wider (more advance users) and also building options have increased (multiple platforms, build mode, configuration flags...). Personally I don't like CMake (despite I know it's pretty standard), I've used it several times and I don't find it user-friendly; plain Makefiles are not way better but at least they do not usually require any external dependency, most compiling packages support them. After some investigation I found premake and it seems pretty powerful, easy and simple to use, very aligned with raylib philosophy... haven't tried yet but Blizzard using it gives me some security and confidence with that tool. In any case, I don't have enough time to work on that, so any contribution on that field is welcomed.
Here there are some game templates (with their own Makefiles): raylib/templates
Wow! Amazing! :D |
sigh: It looks like OS X also has this inconsistent The only solution I can think of now is that when you build GLFW for OS X or Linux, it will also include some things for Only thing would now to be telling our users that they need I'd rather see what the GLFW devs have to say about the |
I've been toying around with I'm going to play around some more to see if this works well. @raysan5 If it does, would you be interesting in switching the build system over from handmade TODO:
Could you also see how my branch works for you on Windows? By default it builds static libraries, but if you toggle the EDIT: |
I prefer to keep current handmade |
The CMake things I'm doing right now are more of a test than anything. I plan on adding targets for RPi, Android, and web. But those will come after Desktop. |
So you develop on Windows. What exactly is your workflow and environment there? MinGW or MSVC? Say if you were given a clean Windows machine, how would you get setup? |
Well, it could sound crazy but all raylib has been developed using Notepad++ with custom compiling scripts preconfigured for MinGW as default compiler. On a clean Windows machine just download and run raylib installer and everything is setup (and portable) to start developing games or modifying the library. For a student, that automatic environment setup is perfect, no brainer! A part of that, I use GitHub to sync the project and I also have a Visual Studio 2015 project (included in installation) in case I need a debugger or some more detailed code analysis... but most of the time I only use Notepad++ with the custom compiling scripts (basically command line direct calls). |
Okay thanks for that info. When I can get my Windows machine back up and running, I'll see if I can get the CMake files to work for that workflow. In other news, I got the examples partially working. So if you check out my I know you're hesitant on using this is the main build system, but so far what I've written has already cleared up the headaches I've had with getting shared and non shared to work on Linux & OS X, and resolving the GLFW issue. If I can get this to be more robust, would you be willing to give it a shot? CMake is not really scary; it just looks that way. I also know that there is already a CMake ticket out there. Instead of reviving it, is it okay if I can go make a fresh one? I'd like a clean working space. |
I'm hesitant to use CMake, I know it's pretty standard in software dev but I prefer to keep a build system with no-dependencies that I can maintain by myself, just in case. In any case, adding support for CMake to raylib is really welcome, once implemented we can find some way to manage both systems (or any other ones). You can open a new ticket for clean discussion, it's ok. :) |
Just closing as per #336. |
I'm off of the branch
develop
right now. But instead of using the latest commit (like in this issue), I grabbed the commit from that pull request of mine you accepted. I'm trying to compiled a shared raylib and I've run into a few hiccups.I've found a few problems:
libglfw3-dev
package is out of date, so I had to compile and installglfw3
from source (which isn't hard), but when I tried to runmake SHARED_LIBRARY=YES
, it failed. When compiling and installing from source, the.so
is installed to/usr/local/lib
, but under the namelibglfw.so
. Right nowsrc/Makefile
is trying to link-lglfw3
for Linux. that3
at the end was causing a "library not found" issue. Removing it made compilation work. What would be a good solution for this? I'm not sure if just purging the3
will not break other things-lglfw3
issue was also inexamples/Makefile
, so that needs to be addressed.examples/Makefile
is also looking for raylib underRAYLIB_PATH ?= C:\raylib\raylib
. This is incorrect. Setting it to../
will make it work. this is also the same case for compiling the examples under OS X. I think one of thosePLATFORM_OS
checks needs to be added heremodels_heightmap.c
.Interestingly enough, when I was trying to get the Nim bindings working,
LoadHeightmap
was also giving me dynamic linking problems.The text was updated successfully, but these errors were encountered: