0

I'm encountering a problem with linking my libraries correctly, and I have already tried various solutions found in multiple threads and websites. However, I haven't been able to resolve the issue. I would greatly appreciate your assistance in solving this problem quickly.

The error I am facing is as follows:

Error LNK2001 Unresolved external Symbol "__imp__vprintf". NinjaPlatformer PathToProgram\Platformer\NinjaPlatformer\Box2D.lib(b2Settings.obj)

Here are my current settings:

  • Include directories: $(SolutionDir)deps/include/;$(SolutionDir);$(IncludePath)
  • Library directories: $(SolutionDir)deps/lib/Release/;$(SolutionDir)Release/bin/;$(LibraryPath)
  • Additional dependencies: SDL2.lib;SDL2_mixer.lib;SDL2_ttf.lib;SDL2main.lib;opengl32.lib;glew32.lib;Bengine.lib;Box2D.lib;%(AdditionalDependencies)

My folder structure is as follows:

Platformer
   Debug
      bin
      some stuff...
   Release
      bin
      some stuff...
   Bengine (My GameEngine)
      some stuff...
   deps
      include
         Box2D, GL, glm, SDL, TTF
      lib
         Debug / Release:
            The libs, I mentioned at the top of the question
   NinjaPlatformer (Main Program)
      some files for main program

I have also included the error log for reference: Error Log (in German)

Gykonik
  • 638
  • 1
  • 7
  • 24
  • Try the line `#undef main` in front of your `int main` function. SDL2 has can have problems with VS2015. Here's some other options: http://stackoverflow.com/questions/28247992/how-to-fix-unresolved-externals-of-sdl-2-0-3-on-visual-studio-2015-preview, and http://gigi.nullneuron.net/gigilabs/setting-up-sdl2-with-visual-studio-2015/ – Ben Feb 29 '16 at 22:44
  • See http://stackoverflow.com/a/32418900/12711 for some info that might help. You might need to rebuild your libraries with VS 2015. – Michael Burr Feb 29 '16 at 22:45
  • Can you please include a dump to what `%(AdditionalDependencies)` resolves to? Because it looks like one of the CRT dependencies is missing or mismatching between your project and `Box2D.lib` – Bishoy Mar 01 '16 at 00:55
  • I guess `%(AdditinalDependencies)` resolves to kernel32.lib _user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib_ – Gykonik Mar 01 '16 at 11:16
  • I'm a bit further... Now my Error message is: Error LNK2001 Unresoved external symbol ""public: void __thiscall Box::init(class b2World *,struct glm::detail::tvec2,struct glm::detail::tvec2,struct Bengine::GLTexture,struct Bengine::ColorRGBA8,bool,struct glm::detail::tvec4)" (?init@Box@@QAEXPAVb2World@@U?$tvec2@M$0A@@detail@glm@@1UGLTexture@Bengine@@UColorRGBA8@7@_NU?$tvec4@M$0A@@45@@Z)". NinjaPlatformer PATH\Platformer\NinjaPlatformer\GameplayScreen.obj – Gykonik Mar 01 '16 at 12:09

0 Answers0