8
« on: April 27, 2012, 01:51:29 am »
Building and running the Threads example works fine, but when I move on to the Window example I get some very strange and obscure compiler errors.
#include <SFML/Window.hpp>
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
// Start main loop
bool Running = true;
while (Running)
{
App.Display();
}
return EXIT_SUCCESS;
}
results in:
Error 6 error LNK1120: 5 unresolved externals C:\Users\Zack\Documents\My Dropbox\Private\VisualStudio\SFML_Test\Debug\SFML_Test.exe SFML_Test
Error 4 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main C:\Users\Zack\Documents\My Dropbox\Private\VisualStudio\SFML_Test\SFML_Test\SFML_Test.obj SFML_Test
Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main C:\Users\Zack\Documents\My Dropbox\Private\VisualStudio\SFML_Test\SFML_Test\SFML_Test.obj SFML_Test
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Window::~Window(void)" (__imp_??1Window@sf@@UAE@XZ) referenced in function _main C:\Users\Zack\Documents\My Dropbox\Private\VisualStudio\SFML_Test\SFML_Test\SFML_Test.obj SFML_Test
Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main C:\Users\Zack\Documents\My Dropbox\Private\VisualStudio\SFML_Test\SFML_Test\SFML_Test.obj SFML_Test
I'm using Windows 7 64 bit, with Visual Studio 2010. When I build SFML I seem to be missing some files:
sfml-audio.lib
sfml-audio-d.lib
sfml-graphics.lib
sfml-graphics-d.lib
sfml-network.lib
sfml-network-d.lib
sfml-system.lib
sfml-system-d.lib
So I just left the original ones in there (from the VC2008 build) and it seemed to work fine. At least the stuff in system example didn't mind.
Any ideas?