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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mbrp

Pages: [1]
1
Aha, I see what I did now.  I glossed over the BIG RED BOX that says
Quote
Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s.lib or sfml-window-s-d.lib for example, you will also have to link opengl32.lib, winmm.lib and gdi32.lib. Some of these dependency libraries might already be listed under "Inherited values", but adding them again yourself shouldn't cause any problems.
When it came to the part where it had the dependencies listed, I went back and referred to a document I had made back when I built 2.0 for vs2010 some while ago, and just copy-pasted the dependencies from that list rather than verifying whether or not anything had changed.  My bad.

Thank you for pointing it out to me.  I'll fix it and see what happens.

Edit:
That was definitely it.  Working fine now.  Thank you and sorry for not reading more carefully.  :)

2
Not sure what exactly I'm doing wrong.

Specifics:
OS: Win 8.1
Target IDE: VS2013 Update 4
Using cmake 3.1.0 win32 x86 (cmake-gui.exe)
Building from SFML-2.2-sources.zip (downloaded from the website, extracted from zip)

Problem:
Following the Compiling SFML (2.2) with CMake guide, I have successfully built and used the dynamic libraries (BUILD_SHARED_LIBS flag TRUE) both in Release and Debug.  However, when I try to use the static libraries I built, I get LNK2001 and LNK2019 unresolved external symbol errors out the wazoo.

Here are the steps I've taken, with some screenshots:
Ran cmake-gui.exe
Pressed Configure
Selected Visual Studio 12 2013 with 'Use default native compilers'
Adjusted Settings to what they are in the screenshot
Pressed Configure again
Pressed Generate

Opened VS2013
Built the 'ALL_BUILD' project on Release
Built the 'INSTALL' project on Release
Built the 'ALL_BUILD' project on Debug
Built the 'INSTALL' project on Debug

This successfully output all the appropriate .lib files in my SFML\lib folder (note: non -s .libs in this folder were built with the BUILD_SHARED_LIBS flag TRUE and work).

Configured Project Properties > Linker > Additional Dependencies (this screenshot is for debug)
 
And here's the code I'm trying to run (again, works fine with dynamic libraries, but gives linker errors with static libraries):
#include <SFML\Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "asdf");
       
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        switch (event.type)
                        {
                        case sf::Event::Closed:
                                window.close();
                                break;
                        case sf::Event::KeyPressed:
                                if (event.key.code == sf::Keyboard::Escape)
                                {
                                        window.close();
                                }
                                break;
                        }
                }

                window.clear();
                window.display();
        }
       
        return 0;
}
 

Sample error:
Quote
Error   1   error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function "private: void __thiscall sf::RenderTarget::applyBlendMode(struct sf::BlendMode const &)" (?applyBlendMode@RenderTarget@sf@@AAEXABUBlendMode@2@@Z)   E:\cppproj\asdf\asdf\sfml-graphics-s-d.lib(RenderTarget.obj)   asdf

Pages: [1]
anything