Hey fellas, I've been following SFMLCoder's youtube tutorials, and things were going just fine, but I seem to have run into a bit of a snag. I'm working with SFML 2.0 in VC++ 2010 on Windows 7.1.
I want to get rid of the console in the release build, so I went to Project > Configuration Properties > Linker > System and changed SubSystem to Windows (/SUBSYSTEM:WINDOWS). Next, I went to Input and added sfml-main.lib as one of the additional dependencies. However, that doesn't seem to be enough. When I compile my program in the release configuration I get this error:
1>------ Build started: Project: ProjectSnuff, Configuration: Release Win32 ------
1>libcmt.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
1>libcmt.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
1>libcmt.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
1>libcmt.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
1>libcmt.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)
1>libcmt.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MSVCRT.lib(cinitexe.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Philadelphia\ProjectSnuff\Release\ProjectSnuff.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I was wondering if you guys have any idea what might be going on? The debug configuration (with the console) works perfectly fine.
I'm also including sfml-graphics.lib, sfml-window.lib, and sfml-system. My code should be right, but it is:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "SFML Sample Application");
while (Window.IsOpen())
{
sf::Event e;
while (Window.PollEvent(e))
{
switch (e.Type)
{
case sf::Event::Closed:
Window.Close();
break;
default:
break;
}
}
Window.Clear(sf::Color(0, 255, 255));
Window.Display();
}
return 0;
}
Thanks for your time!