adamhynek / higgs

Adds many native VR mechanics and enhanced physics to Skyrim VR
GNU General Public License v3.0
19 stars 4 forks source link

Building issue #1

Closed extract closed 2 years ago

extract commented 2 years ago

Hello!

I have set up the environment to the best of my abilities (required libs and build tools, skse src and workspace set up). However, I encounter an issue while building where members of certain SKSE classes are private but being used anyway.

One example is this:

void ReplaceBSString(BSString &replacee, std::string &replacer)

Error C2248 'BSString::m_data': cannot access private member declared in class 'BSString' higgs_vr f:\source\higgs\src\utils.cpp 909

where the BSString replacee variable tries to access private members m_data, m_dataLen and m_bufLen, where as they are in SKSE defined as private: char * m_data; // 00 UInt16 m_dataLen; // 08 UInt16 m_bufLen; // 0A

I know that if I get past this (by changing the source code just to try... :) ) there's plenty more of these private issues.

How do I do to solve this? I really want to play around with this code and hopefully contribute!

Thanks!

adamhynek commented 2 years ago

You'll need to make any of these public manually like you've already done I'm afraid. SKSE is less of a library and more of a source of reverse-engineered structures from the game, and you need to get at their "private" members to make changes to them. You'll also likely need to do this for some of the havok classes, as well as get rid of a bunch of macro calls for those. It makes building this from scratch kind of a pain, so I'm sorry about that. Please let me know if you run into anything else!

extract commented 2 years ago

Aha, I just wasn't sure if it would work doing it like that! If that's how you have done it, then no worries I'll do that.

My biggest issue now is that I can't solve the linker issues actually. I try to add them to the static lib, but clearly it doesn't work.

I even try to add the SKSE static lib but still I get a ton of these types of linking issues:

unresolved external symbol "public: class NiPoint3 __cdecl NiPoint3::operator+(class NiPoint3 const &)const " (??HNiPoint3@@QEBA?AV0@AEBV0@@Z) higgs_vr F:\source\higgs\finger_animator.obj 1

And even worse it seems static hk lib is only built for win32, but maybe only the source is required, not the lib?

I appreciate the help!

adamhynek commented 2 years ago

Hmm, something must be going wrong with including the skse libs. Do you see them being generated in visual studio's build directories? I feel like I had some difficulty with it too, but it's been a long time since I set this up...

Regarding havok, yeah there are no libs for it, and you shouldn't need any. Any havok functions that are not inlined in the headers I've had to find in the skyrimvr exe. I have offsets for a bunch of them in the offsets files.

extract commented 2 years ago

I see, I was supposed to change the skse to a static lib instead of dll. I only included the common lib before.

I also got rid of some defines from hk, but I'm not just there yet. I got 5 unresolved left, that I don't know how to deal with.

You got any hints for these ones? P.S., If you prefer to help in real time, my discord is ****, assuming you use discord.

Edit to remove some information

extract commented 2 years ago

After some quite a lot of small modifications to havok and a lot of help from Adam it compiled!

As a future suggestion: a better integration would be good if new environment is being set up. Maybe some sort of automation.

Issue is closed.