Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved externals when using as statically linked library #56

Open
48cf opened this issue Sep 6, 2019 · 0 comments
Open

Unresolved externals when using as statically linked library #56

48cf opened this issue Sep 6, 2019 · 0 comments

Comments

@48cf
Copy link

48cf commented Sep 6, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant