Search code examples
c++lnk2001

VS15: error LNK2001: unresolved external symbol


While declaring code, I got two errors - Unresolved external symbol and 1 unresolved externals. I see that the first causes the second one. The 'graphics' folder is located in the Project Location: C:\Users\cpp_shared\documents\visual studio 2015\Projects\TIMBER\graphics

SFML libraries declared in Project->Properties->Debug->Linker->Input: sfml-graphics-d.lib;sfml-window-d.lib;sfml-system-d.lib;sfml-network-d.lib;sfml-audio-d.lib;

I would be very happy if anyone could help me :)

Code:

#include "stdafx.h"
#include <SFML/Graphics.hpp>
//Using SFML namespace
using namespace sf;

int main()
{
 //Create VideoMode object 'vm'
 VideoMode vm(1920, 1080);

 //Create RenderWindow object 'window'
 //render 'window' with params
 RenderWindow window(vm, "TIMBER", Style::Default);

 //Create Texture object 'textureBackground'
 Texture textureBackground;

 //Load image into the object 'textureBackground'
 textureBackground.loadFromFile("graphics/background.png");

 //Sprite needs a texture to display itself as an image
 //Create Sprite object 'spriteBackground'
 Sprite spriteBackground;

 //Attach the texture to the Sprite
 spriteBackground.setTexture(textureBackground);

 //Set spriteBackground to 0x0 position
 spriteBackground.setPosition(0, 0);

 //Close the window by pressing ESC
 while (window.isOpen())
 {
     if (Keyboard::isKeyPressed(Keyboard::Escape)) {
         window.close();
     }
 }

 //Clear the window before rendering new frame
 window.clear();

 //Draw spriteBackground
 window.draw(spriteBackground);

 //End current frame and display it
 window.display();

 return 0;
}

Errors:

Error LNK2001 unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)

Error LNK1120 1 unresolved externals TIMBER C:\Users\cpp_shared\documents\visual studio 2015\Projects\TIMBER\Debug\TIMBER.exe


Solution

  • Well, a solution was obvious - VS15 on WIN10 Enterprise uses Host user credentials for executing programs. Once ConnectionString was changed to AD, a program was able to read from storage.