How do I statically include Assimp into my game using Premake?

Started by
7 comments, last by EBZ 3 years, 8 months ago

I'm trying to include Assimp into my project using Premake but so far only accomplished to successfully include GLFW and Glad. This is because I copy and pasted the premake5.lua script from a The Cherno tutorial video.

I also looked for examples on Github but all of them seem to be working with an older version of assimp which has a different file structure. Would anybody have a lua script that successfully includes Assimp into their project?

I'd like to do what I did with this script (https://pastebin.com/y9hUfWw3) but for assimp. Hope this makes sense, thanks!

Advertisement

Currently running into the same problem (I am also using a script derived from TheCherno's). I am trying to execute the ASSIMP cmake command from my top-level premake5.lua script with os.execute. Then, in the “Dependecies” group, I am adding the vendor/assimp folder as “includeexternal” where I have another premake5.lua script that declares an “externalproject”. Not sure why i told you all of this because I run into 165 compilation errors, complaining about things such as inaccessible includes and weird things like “map” is not a member of namespace “std”. This is brutal.

@undefined OMG I found the answer seconds after posting this. Check this out: https://github.com/AminAliari/assimp.​ Do a git submodule add <url> <path-to-submodule>. Then add the path to the submodule to the “dependencies” group in your premake5.lua script. AND THATS IT!

deadbird11 said:

@undefined OMG I found the answer seconds after posting this. Check this out: https://github.com/AminAliari/assimp.​ Do a git submodule add <url> <path-to-submodule>. Then add the path to the submodule to the “dependencies” group in your premake5.lua script. AND THATS IT!

@undefined I'm needing this so much! Do you have the correct link? The link is broken :(

Update: Actually, I just needed to remove the period at the end! Thanks!! Can't wait to try this in morning! I'll let you know if it worked for me.

@deadbird11 Quick question did you ever get it to work with FBX files? I can't find a way to get it load an FBX. I looked at the premake5.lua file, and commented out the "--"ASSIMP_BUILD_NO_FBX_IMPORTER", flag. I even added all the fbx files found in the code/ folder in the files {} portion of the lua file and all i get is this:


LNK2019 unresolved external symbol inflate referenced in function "void __cdecl Assimp::FBX::`anonymous namespace'::ReadBinaryDataArray(char,unsigned int,char const * &,char const *,class std::vector<char,class std::allocator<char> > &,class Assimp::FBX::Element const &)" (?ReadBinaryDataArray@?A0xfa806f17@FBX@Assimp@@YAXDIAEAPEBDPEBDAEAV?vector@DV?vector@DV?vector@DV?allocator@D@std@@@std@@AEBVElement@23@@Z)

I don't know what this means aside from the description found on google. I'm clearly linking incorrectly and it's maybe not finding a definition found in the library? Not sure what to do :(

@EBZ Maybe go to their github and look at that file (where the err is coming from) and look through the headers it includes for where “inflate” is declared, then find the .cpp file that implements it. Unresolved external symbol usually means it is missing an implementation in a .cpp file, so you probably have to include the one that implements “inflate” in your project in the premake5 lua script. I am using .obj files and it did the trick for those. If you figure it out, you should post your fix as a fork of the github page I found so that others can find that solution as well.

@EBZ Did you ever get this to work? I just bought a model from TurboSquid and they are only giving it to me in FBX form…

Hey what's up @deadbird11 I got to be honest, I have up :( I ended up making a gltf loader and I'm still working out a few issues.

This topic is closed to new replies.

Advertisement