Francesco149 / oppai-ng

difficulty and pp calculator for osu!. better, smaller, faster rewrite of https://github.com/Francesco149/oppai
The Unlicense
155 stars 36 forks source link

Unresolved externals when using as statically linked library #56

Open 48cf opened 5 years ago

48cf commented 5 years ago

I am including/linking oppai using following code, and when compiling this simple snippet:

#pragma comment(lib, "oppai.lib")

extern "C"
{
    #include "../thirdparty/oppai.c"
}

int main()
{
    ezpp_t pp_calculator = ezpp_new();

    ezpp_set_autocalc(pp_calculator, 1);
    ezpp(pp_calculator, "-");
}

I am getting following build errors:

1>swap_buffers.obj : error LNK2019: unresolved external symbol __imp__ezpp_new referenced in function "int __stdcall hooks::swap_buffers(unsigned int)" (?swap_buffers@hooks@@YGHI@Z)
1>swap_buffers.obj : error LNK2019: unresolved external symbol __imp__ezpp referenced in function "int __stdcall hooks::swap_buffers(unsigned int)" (?swap_buffers@hooks@@YGHI@Z)
1>swap_buffers.obj : error LNK2019: unresolved external symbol __imp__ezpp_set_autocalc referenced in function "int __stdcall hooks::swap_buffers(unsigned int)" (?swap_buffers@hooks@@YGHI@Z)

The code I posted above obviously isn't exactly how I use it, but inside main are all function I am invoking. I built oppai using "libbuild.bat" from the "x86 Native Tools Command Prompt for VS 2017", and as you might have read, I am using Visual Studio 2017. Only settings changed in the project is the C++ language standard, which is set to C++17.