I am new here. My programming skills are not that great but am one of those that prefers to go the C++ route. At the advice of one of the posts I found somewhere in this forum I installed the SFML libraries and started the tutorials. I was enjoying learning it and everything worked fine until I got to the launch a window tutorial. I put the code in and got a bunch of error messages (see below):
I am not sure what I did wrong. In the tutorial they mentioned this: "Under Windows operating systems, you may have created a "Windows Application" project, especially if don't want the console to show up. In such case, to avoid replacing main by WinMain, you can link with SFML_Main static library and keep a standard and portable main entry point. " I wasn't sure how to accomplish "link with SFML_MAIN static library" and that may be the source of the error messages, but I am new to this so really not sure. If anybody knows how I can get this to work so I can go on with the tutorials, I would really appreciate the help.
Thank you!
(I also posted the full source below)
1>------ Build started: Project: SFML-tutorials, Configuration: Debug Win32 ------
1>Linking...
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Window::~Window(void)" (__imp_??1Window@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : 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
1>main.obj : 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
1>C:\Users\colorado\Documents\Visual Studio 2008\Projects\SFML-tutorials\Debug\SFML-tutorials.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Users\colorado\Documents\Visual Studio 2008\Projects\SFML-tutorials\SFML-tutorials\Debug\BuildLog.htm"
1>SFML-tutorials - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#include <SFML/Window.hpp>
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
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();
}
//system ("pause");
return EXIT_SUCCESS;
}