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

Author Topic: 1.6 Static Linking in VS2010 with MFC in Shared DLL [SOLVED]  (Read 3255 times)

0 Members and 1 Guest are viewing this topic.

Redemption

  • Newbie
  • *
  • Posts: 4
    • View Profile
1.6 Static Linking in VS2010 with MFC in Shared DLL [SOLVED]
« on: August 28, 2012, 09:19:36 pm »
Hello,

I'm using SFML 1.6 in VS2010 (I recompiled from source for VS2010). I use the static libraries, and it works well when the project setting is:
 - "Use of MFC: Use standard Windows libraries"

using this test code:
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main(){
        sf::RenderWindow wnd( sf::VideoMode(100,200), "Angled Image");
}

Unfortunately, I need this project to also use some other libraries, which use a MFC shared DLL. So, as soon as I change that setting to:
 - "Use of MFC: MFC in a Shared DLL"

I get a linker error, "error LNK1120: 38 unresolved externals". Does SFML use some libraries that would be included when I set "use standard Windows libraries", but I might have to manually include when I change that? Or, you know, any other reason this setting might mess up my build?

Thanks!
« Last Edit: August 28, 2012, 09:42:04 pm by Redemption »

Redemption

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: 1.6 Static Linking in VS2010 with MFC in Shared DLL [SOLVED]
« Reply #1 on: August 28, 2012, 09:43:33 pm »
I have solved it. When it's set to "standard windows libraries", it includes the following in the "Additional Dependencies" field:

kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

So I just had to manually include those after I changed it to "MFC using Shared DLL", and voila!