enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

The OSX binaries have some fancy linking? #59

Open reppolice opened 6 years ago

reppolice commented 6 years ago

Hi,

I got the latest binaries, have the latest OSX, chmod +x LimonEngine, and ....

dyld: Library not loaded: @rpath/libopenal.1.dylib

Should I be worried?

enginmanap commented 6 years ago

Hey! I would assume the engine won't launch, but your wording let me to believe it does. Please clearify whats going on.

1) Does the engine launch? 2) If it does, do you get any sound?

Since OpenAL is custom built, it is possible we didn't get all the parameters right or something. It would be perfect if you can help us identify the issue better.

reppolice commented 6 years ago

It does not launch, apparently this lib is a fatal error. But yeah, wouldn't it be nice if at least failed gracefully with other components running!

enginmanap commented 6 years ago

Hey @reppolice could you try to run the engine with these files on the same path with the executable?

libopenal.1.18.2.zip

reppolice commented 6 years ago

It was not so simple. Some magic rpath is necessary, it seems. I wonder if those 1970 timestamps are some misconfiguration on your part. This selection of "otool -l LimonEngine | more " looks very suspicious!

Load command 11 cmd LC_MAIN cmdsize 24 entryoff 41008 stacksize 0 Load command 12 cmd LC_LOAD_DYLIB cmdsize 56 name @rpath/libopenal.1.dylib (offset 24) time stamp 2 Thu Jan 1 01:00:02 1970 current version 1.18.2 compatibility version 1.0.0 Load command 13 cmd LC_LOAD_DYLIB cmdsize 72 name /usr/local/opt/tinyxml2/lib/libtinyxml2.6.dylib (offset 24) time stamp 2 Thu Jan 1 01:00:02 1970 current version 6.2.0 compatibility version 6.0.0 Load command 14 cmd LC_LOAD_DYLIB cmdsize 80 name /usr/local/opt/bullet/lib/libBulletDynamics.2.87.dylib (offset 24) time stamp 2 Thu Jan 1 01:00:02 1970 current version 2.87.0 compatibility version 2.87.0

enginmanap commented 6 years ago

These library files were compiled in ./libs/OpenAL-Soft/ directory, so I am assuming the @rpath should be there. can you check what ldd gives?

reppolice commented 6 years ago

Otool is the ldd on OSX. I am getting the same behaviours on the previous OSX. Anyway, decided to compile for OSX, and even though "brew install gml" was enough for cmake, it was not enough for make:

/limonEngine/src/FontManager.h:15:10: fatal error: 'glm/detail/type_vec.hpp' file not found

enginmanap commented 6 years ago

Can you change that line to:

include <glm/glm.hpp>

and try again?

enginmanap commented 6 years ago

Hi,

I just tested on a freshly installed high sierra. The line change fixes the issue. I installed the following using homebrew: gcc cmake sdl2 sdl2_imagei bullet glm tinyxml2 freetype assimp pkgconfig

Please keep in mind, you need to copy the data folder from the releases over to new build.

reppolice commented 6 years ago

I believe you generally, "sdl2_imagei" above is a typo, but now I am getting

/limonEngine/src/Utils/GLMConverter.h:9:10: fatal error: '../glm/gtx/quaternion.hpp' file not found

include "../glm/gtx/quaternion.hpp"

reppolice commented 6 years ago

Right, it looks like these glm includes are all over the place, I did several edits but still ended up with errors, I have no idea how you managed to compile this, are you sure you started with git clone? It is also quite hard to guess what those ../glm are doing in the source code, but perhaps they should just become part of the tree, inelegant as it may be. Looks like someone deleted them or excluded them from git.

enginmanap commented 6 years ago

Yep, I did that, a whole year ago. It is funny none of my compile environments are complaining about it.

May I ask you to join the Discord? We can fix the issues way faster by instant messaging

reppolice commented 6 years ago

Sure, but at the end of the day we are trying to have something compilable for the average Joanne who does a git clone here (or even gets the binary!)

reppolice commented 6 years ago

By the way, setting some stuff on git ignore and then having newcomers compile problems, there is nothing weird about that, the opposite would be weird! Looks like you haven't been fresh-cloning your projects for the 3rd party experience

enginmanap commented 6 years ago

Of couse I did :-) The engine is compiled on different computers. Last night I installed MacOS to my desktop, cloned and compiled.(I think git bring up something like apple development tools or something with it). Also the directory is not in gitignore, I literally deleted it from local and pushed. I think you and I are using different compilers or cmake configurations, that is the root of the issue. Some how my installation ignores it, and yours act correctly.

If you have the working copy, you can create a PR, as part of hactoberfest. If you don't want to, I need to clean up the leftovers, as you stated, it should be working for 3rd parties.

reppolice commented 6 years ago

Well, I refreshed everything a bit but still was not able to compile:

/limonEngine/src/Assets/../Utils/GLMConverter.h:41:16: error: implicit instantiation of undefined template 'glm::qua<float, glm::packed_highp>' return glm::quat(quaternion.w, quaternion.x, quaternion.y, quaternion.z);

Could be because of my previous "fixes":) Did you post your compiled binary anywhere?

enginmanap commented 6 years ago

there is no glm::qua, I am assuming it is glm::quat.

the GLMConverter.h includes 2 headers, maybe you are missing:

include <glm/gtx/quaternion.hpp>

https://github.com/enginmanap/limonEngine/blob/bfa2ca28b621fb0ca9306efdcab3501eb78d49a7/src/Utils/GLMConverter.h#L9

enginmanap commented 5 years ago

It turns out this is because of a compile flag. SO link below

https://stackoverflow.com/questions/43330165/how-to-link-a-shared-library-with-cmake-with-relative-path