sneakyevil / IL2CPP_Resolver

A run-time API resolver for IL2CPP Unity.
https://sneakyevil.gitbook.io/il2cpp-resolver/
The Unlicense
364 stars 67 forks source link

How do I include this into my project? #28

Closed karaok1 closed 1 year ago

karaok1 commented 1 year ago

In Visual Studio 2022, I added this line into C/C++ -> Additional Include Directories C:\Path\To\Project\IL2CPP_Resolver

When I include #include "Main.hpp"

And use something like this:

IL2CPP::Initialize(); // This needs to be called once!
Unity::il2cppArray<Unity::CGameObject**>* m_pObjects = Unity::Object::FindObjectsOfType<Unity::CGameObject*>("UnityEngine.GameObject");

Then I get these errors: devenv_Eye0e4MqKT

I am not a cpp dev so excuse my ignorance.

karaok1 commented 1 year ago

So apparently I had to build IL2Cpp_Resolver project and link the .lib file in Input->Additional Dependencies. Now it compiles without errors.