Ryan-rsm-McKenzie / CommonLibSSE

A reverse engineered library for hacking Skyrim Special Edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to build any plugin

Vermunds opened this issue · comments

The library itself compiles just fine.
However, any plugin that relies on it fails to compile with the same error messages. Example output here.
From what I can tell, it seems like the problem is caused by conflicts between the constants defined in SKSE/Impl/WinAPI.h and in Winnt.h.
Just including RE/Skyrim.h or SKSE/SKSE.h in my projects seems to include both implicitly (without including them these constants are not defined at all).
Any advice/fix would be appreciated.

include windows.h (or xbyak) after commonlib

Neither makes any difference. I don't even use xbyak in this case.

show me your code

It happens even with no code (aside from the load and query functions), but here is the one I'm trying, it's a rather simple one:
https://github.com/Vermunds/TimeFormatChanger-SE/tree/Test

add SPDLOG_COMPILED_LIB to your defines

Okay, that certainly helped. I'm now getting unresolved externals in WinAPI. At least it's something different. Anyways, here is it:

4>CommonLibSSE.lib(WinAPI.obj) : error LNK2019: unresolved external symbol GetFileVersionInfoSizeW referenced in function "unsigned int __cdecl SKSE::WinAPI::GetFileVersionInfoSize(wchar_t const *,unsigned int *)" (?GetFileVersionInfoSize@WinAPI@SKSE@@YAIPEB_WPEAI@Z)
4>CommonLibSSE.lib(WinAPI.obj) : error LNK2019: unresolved external symbol GetFileVersionInfoA referenced in function "bool __cdecl SKSE::WinAPI::GetFileVersionInfo(char const *,unsigned int,unsigned int,void *)" (?GetFileVersionInfo@WinAPI@SKSE@@YA_NPEBDIIPEAX@Z)
4>CommonLibSSE.lib(WinAPI.obj) : error LNK2019: unresolved external symbol GetFileVersionInfoW referenced in function "bool __cdecl SKSE::WinAPI::GetFileVersionInfo(wchar_t const *,unsigned int,unsigned int,void *)" (?GetFileVersionInfo@WinAPI@SKSE@@YA_NPEB_WIIPEAX@Z)
4>CommonLibSSE.lib(WinAPI.obj) : error LNK2019: unresolved external symbol VerQueryValueA referenced in function "bool __cdecl SKSE::WinAPI::VerQueryValue(void const *,char const *,void * *,unsigned int *)" (?VerQueryValue@WinAPI@SKSE@@YA_NPEBXPEBDPEAPEAXPEAI@Z)
4>CommonLibSSE.lib(WinAPI.obj) : error LNK2019: unresolved external symbol VerQueryValueW referenced in function "bool __cdecl SKSE::WinAPI::VerQueryValue(void const *,wchar_t const *,void * *,unsigned int *)" (?VerQueryValue@WinAPI@SKSE@@YA_NPEBXPEB_WPEAPEAXPEAI@Z)

rebase on upstream

I'm on the latest version already.

link version.lib

And that did it. It compiles now. A lot of warnings though, but I'm not complaining. It works.
Thanks for the help.

This process is a lot easier if you use the cmake integration

Yeah I figured. I'm just not too used to CMake yet.