Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unresolved external symbol: __imp__*  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

Culinary

  • Newbie
  • *
  • Posts: 9
    • View Profile
Unresolved external symbol: __imp__*
« on: November 18, 2015, 01:23:44 pm »
Using Visual Studio 2012, downloaded SFML 2.3.2 Visual C++ 11 (2012).

Project Options, Release Configuration:

C/C++
 -- General
     Additional Include Dependencies: Z:\SFML-2.3.2\include;

-- Preprocessor
    Preprocessor Definitions: SFML_STATIC;

Linker
-- General
     Additional Library Directories: Z:\SFML-2.3.2\lib;

-- Input
     Additional Dependencies: sfml-graphics-s.lib;sfml-window-s.lib;sfml-system-s.lib;sfml-main.lib;

main.cpp:
int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

Errors:
Quote
error LNK2001: unresolved external symbol __imp__glReadPixels@28
error LNK2001: unresolved external symbol __imp__glBlendFunc@8
error LNK2001: unresolved external symbol __imp__glClear@4

...List goes on.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Laurent Gomila - SFML developer

Culinary

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Unresolved external symbol: __imp__*
« Reply #2 on: November 18, 2015, 01:36:35 pm »
Ah I didn't realise there were new dependencies for 2.3.

Added these and it worked:
Quote
opengl32.lib
freetype.lib
winmm.lib
gdi32.lib
jpeg.lib

Question though, why does this version of SFML use these dependencies as opposed to previous versions?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unresolved external symbol: __imp__*
« Reply #3 on: November 18, 2015, 02:06:45 pm »
If you search a little bit, you can find the corresponding discussion on the forum and/or github ;)

Short answer: it was ugly and non-conventional to stuff the dependencies directly into the SFML libraries.
Laurent Gomila - SFML developer