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 external symbol with shared library build #670

Closed
jarrettchisholm opened this issue Jan 30, 2016 · 4 comments
Closed

unresolved external symbol with shared library build #670

jarrettchisholm opened this issue Jan 30, 2016 · 4 comments

Comments

@jarrettchisholm
Copy link

I'm not sure if this is the right place to put this ( I wasn't able to find a mailing list), so please forgive me if this is the wrong place.

I'm getting various unresolved external symbol errors when I try to compile on Windows 10 against the shared library build of BGFX.

I generated the Visual Studio project files using Genie, with the shared library option specified. I have the bgfx-shared-libRelease Binaries built successfully using Visual Studio 2015.

if I remove the bgfx-shared-libRelease Library from my build tool (SConstruct), I get the same unresolved external symbol errors. It's like the symbols aren't being recognized.

does anyone have any suggestions I might try?

Here's the open I'm seeing (GraphicsEngine is my CPP file that is making calls into BGFX):

GraphicsEngine.obj : error LNK2019: unresolved external symbol "bool __cdecl bgfx::init(enum bgfx::RendererType::Enum,unsigned short,unsigned short,struct bgfx::CallbackI *,struct bx::AllocatorI *)" (?init@bgfx@@YA_NW4Enum@RendererType@1@GGPAUCallbackI@1@PAUAllocatorI@bx@@@Z) referenced in function "public: __thiscall graphics::bgfx::GraphicsEngine::GraphicsEngine(unsigned __int64)" (??0GraphicsEngine@bgfx@graphics@@QAE@_K@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::shutdown(void)" (?shutdown@bgfx@@YAXXZ) referenced in function "public: virtual __thiscall graphics::bgfx::GraphicsEngine::~GraphicsEngine(void)" (??1GraphicsEngine@bgfx@graphics@@UAE@XZ)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::reset(unsigned int,unsigned int,unsigned int)" (?reset@bgfx@@YAXIII@Z) referenced in function "public: __thiscall graphics::bgfx::GraphicsEngine::GraphicsEngine(unsigned __int64)" (??0GraphicsEngine@bgfx@graphics@@QAE@_K@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl bgfx::frame(void)" (?frame@bgfx@@YAIXZ) referenced in function "public: virtual void __thiscall graphics::bgfx::GraphicsEngine::render(float)" (?render@GraphicsEngine@bgfx@graphics@@UAEXM@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::setDebug(unsigned int)" (?setDebug@bgfx@@YAXI@Z) referenced in function "public: __thiscall graphics::bgfx::GraphicsEngine::GraphicsEngine(unsigned __int64)" (??0GraphicsEngine@bgfx@graphics@@QAE@_K@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::dbgTextClear(unsigned char,bool)" (?dbgTextClear@bgfx@@YAXE_N@Z) referenced in function "public: virtual void __thiscall graphics::bgfx::GraphicsEngine::render(float)" (?render@GraphicsEngine@bgfx@graphics@@UAEXM@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::dbgTextPrintf(unsigned short,unsigned short,unsigned char,char const *,...)" (?dbgTextPrintf@bgfx@@YAXGGEPBDZZ) referenced in function "public: virtual void __thiscall graphics::bgfx::GraphicsEngine::render(float)" (?render@GraphicsEngine@bgfx@graphics@@UAEXM@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::setViewRect(unsigned char,unsigned short,unsigned short,unsigned short,unsigned short)" (?setViewRect@bgfx@@YAXEGGGG@Z) referenced in function "public: virtual void __thiscall graphics::bgfx::GraphicsEngine::render(float)" (?render@GraphicsEngine@bgfx@graphics@@UAEXM@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "void __cdecl bgfx::setViewClear(unsigned char,unsigned short,unsigned int,float,unsigned char)" (?setViewClear@bgfx@@YAXEGIME@Z) referenced in function "public: __thiscall graphics::bgfx::GraphicsEngine::GraphicsEngine(unsigned __int64)" (??0GraphicsEngine@bgfx@graphics@@QAE@_K@Z)
GraphicsEngine.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl bgfx::touch(unsigned char)" (?touch@bgfx@@YAIE@Z) referenced in function "public: virtual void __thiscall graphics::bgfx::GraphicsEngine::render(float)" (?render@GraphicsEngine@bgfx@graphics@@UAEXM@Z)
build\darkhorizon.exe : fatal error LNK1120: 10 unresolved externals
scons: *** [build\darkhorizon.exe] Error 1120
scons: building terminated because of errors.
@bkaradzic
Copy link
Owner

When you're dynamically linking, you have to use C99 API, C++ API doesn't have DLL import/export.

Dynamic linking will be fixed eventually. Right now it exist mostly to support other language bindings.

@jarrettchisholm
Copy link
Author

oh I see, thanks @bkaradzic.

@sammamacha
Copy link

Has this been fixed yet or is it still in the works? Had this same issue.

@SuadoCowboy
Copy link

as 2024 and I'm wondering too

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

4 participants