limonEngine icon indicating copy to clipboard operation
limonEngine copied to clipboard

The OSX binaries have some fancy linking?

Open reppolice opened this issue 7 years ago • 17 comments

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?

reppolice avatar Sep 30 '18 18:09 reppolice

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.

enginmanap avatar Sep 30 '18 20:09 enginmanap

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!

reppolice avatar Sep 30 '18 22:09 reppolice

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

libopenal.1.18.2.zip

enginmanap avatar Oct 01 '18 11:10 enginmanap

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

reppolice avatar Oct 02 '18 08:10 reppolice

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?

enginmanap avatar Oct 02 '18 11:10 enginmanap

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

reppolice avatar Oct 03 '18 17:10 reppolice

Can you change that line to:

#include <glm/glm.hpp>

and try again?

enginmanap avatar Oct 03 '18 19:10 enginmanap

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.

enginmanap avatar Oct 03 '18 22:10 enginmanap

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 avatar Oct 03 '18 23:10 reppolice

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.

reppolice avatar Oct 04 '18 01:10 reppolice

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

enginmanap avatar Oct 04 '18 08:10 enginmanap

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 avatar Oct 04 '18 17:10 reppolice

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

reppolice avatar Oct 04 '18 18:10 reppolice

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.

enginmanap avatar Oct 04 '18 19:10 enginmanap

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?

reppolice avatar Oct 15 '18 18:10 reppolice

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 avatar Oct 15 '18 19:10 enginmanap

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

enginmanap avatar Apr 23 '19 13:04 enginmanap