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 - TheRabbit

Pages: 1 [2]
16

Ok, so I tried the code from the official tutorials but the problem is still there. Again the problem is that when i use the same computer as the server and the client the program works but when I use another computer as a client and another as a server, it doesn't work. And the two computers are on the same wifi.

Can you post your code using {code} tags? Or a link to the code you used and what changes you made to it.

17
Network / Re: Container(list) of TcpSockets not behaving (NonCopyable)
« on: November 06, 2013, 02:53:24 pm »
Thanks for the reply, but I'm not sure I follow. I can't do a `push` using a pointer from what I've read and attempted, and dereferencing the pointer gives me the same issue, noncopyable.

18
Network / Container(list) of TcpSockets not behaving (NonCopyable)
« on: November 06, 2013, 05:17:04 am »
My server uses a list of TcpSockets called host:
std::list<sf::TcpSocket> host; //sockets we will use to communicate

When I go to add a new socket, I'm unable to:
host.push_back(sf::TcpSocket());
This code gives me an error regarding the 'NonCopyable' declaration.

Code: [Select]
c:\sfml-2.1-windows-vc11-32bits\sfml-2.1\include\sfml\network\socket.hpp(178): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
1>          c:\sfml-2.1-windows-vc11-32bits\sfml-2.1\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
1>          c:\sfml-2.1-windows-vc11-32bits\sfml-2.1\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Socket::Socket(const sf::Socket &)'

Is there a way around this? Before, I was using a fixed array of TcpSockets:
sf::TcpSocket host[10];
and had no problems, but it wasn't very robust. I'm trying to make the server a bit more robust to allow it to create new connections and delete old ones without going though all of the hoops I went through using a fixed array.

What can I do to get around this?

I've tried making a new class that (for right now) only holds a sf::TcpSocket item in it. But it seems to be an inherent problem with the way that 'push' works on containers, in that it creates a copy of the item before putting it into the list. Since TcpSockets are special and can't be copied (I assume that would cause actual problems and I shouldn't just overload it) I can't add a new one into a list.

19
Window / Re: Clicking in Window Doesn't Give Focus
« on: November 02, 2013, 10:56:21 pm »
Is there a way that I can fix this using an sf::Event? Or is the only way around it to use a dev build?

20
Thanks, I think I'll implement the chat history using a deque so I can pop front and back. I'd never heard of these container classes before about a week ago, it looks like they were only added into the standard about 15 years ago, so I've never ran into them at work.

Thanks again.

21
Don't use arrays. Replace them with STL containers, usually std::vector (or std::array if you really need fixed size without dynamic allocations, which is not the case here).
Good point, I'm working on replacing it with a std::vector now. But I have a couple questions...

Quote
Pass class objects in general by const-reference.
Done.

Quote
Use a consistent name convention. str_in doesn't match the rest.
Done.

Quote
Combine nested if conditions:
Done.

Quote
Then, you can use references to create an alias for an often used object:
Good idea!

Quote
Use more meaningful variable names than "temp". Why do you even need to store the string again?
That was some debugging code that I missed before pasting it here.

Quote
Check if a socket receipt is successful, and not only if one specific error occurs.
Good point, there could be other events that occur other than receiving a message.

Quote
Don't declare variables long before they are used. Declaring all necessary variables at the beginning of a function or block is ancient practice originating from C89 (that's a quarter of a century!).
That's when I first learned to code (early 90's), some habits are so ingrained I have a difficult time changing them.

Quote
Instead of
for (i=1;i<20;i++)
    chatText[i-1] = chatText[i]; //shift all the messages down to accept a new message
you can simply erase the front element of an STL container. Maybe std::deque, but also std::vector won't hurt for such few elements.
Ok, here's where I need help. I know I can pop the ends off of std::vectors, but how do I pop the front off? That for loop basically just shifts everything down a slot (0 holds what used to be 1, 1 holds what used to be 2, etc.). So to effectively pop I'd need to pop element 0 off, and I don't think std::vectors can do that.

I changed the loop to:
        for (std::vector<sf::Text>::iterator it = chatText.begin() + 1; it != chatText.end(); it++)
                *(it - 1) = *it; //this might work?
for now so that I'm not using magic numbers any more.


Quote
Instead of
chatText[19].setString(sf::String(str_in)); //put the new message in
you use the container's member function push_back().
I can't really use this until I find a way to pop the front of the vector off. So instead I'm using:
chatText[MAXHISTORY - 1].setString(sf::String(stringIn)); //put the new message in
for now.

Quote
Don't ever refer to magic number indices, use front() and back() to highlight the special meaning of these elements.
Good point, I'm using front and back now.

Quote
One option is also to separate the graphical update and the draw() calls.
I already had a function for this, I just haven't moved the code into there yet for debugging purposes.

Quote
Furthermore, after cleaning up the code, make sure the high-level logic is clearly understandable. This will also help you see if there are mistakes or potential for simplification.
Thanks for all the tips.

I still can't figure out how to scroll the chat input that the user is typing. I guess I could use a substr or something when I display it?
Edit: I tried using a substring and it looks like I'll have to do the whole glyph calculation thing again thanks to non fixed width characters...
Edit2: got it working:
void Game::updateUserInput()
{
        int lineSize = 0;
        for (unsigned int i = currentInput.length(); i > 0; i--)
        {
                sf::Glyph glyph = chatFont.getGlyph(currentInput[i],drawableInput.getCharacterSize(),false); //get the current character
                if ((lineSize + glyph.advance) > 570) //check for runoff
                {
                        drawableInput.setString(sf::String(currentInput.substr(i)));
                        return; //break out if we get to the point where the chat line is too long!
                }
                else
                        lineSize += glyph.advance; //increment linesize by the texture size of the current character
        }
        //if we made it to here the text the user has inputted isn't longer than the line length
        drawableInput.setString(sf::String(currentInput));
}

22
My game has a multiplayer chat box in it, and I'm having a tough time implementing a scrolling and word wrapping chatbox without using a hammer. It works, but I feel like I'm using way too many variables and some really messy arrays to get it done.

Here's the relevant code bits (the really relevant parts are down in Game::pushMessage()):
class Game
{
public:
        Game();
        void run();

private:
        //...
        void processEvents();
        void render();
        void processInput(); //handles what happens when the user has types something and presses enter
        void pushMessage(std::string str_in, sf::Color color=sf::Color::Black); //puts a new message onto the stack
        //...

private:
        //...
        sf::Font chatFont;
        int chatLineFocus; //integer showing which chat line the client is currently looking at (allows scrolling text)
        sf::Text chatText[20]; //holds the last 20 rows of text that shows up in the chat box
        //...
};
//...
Game::Game()
{
        //...
        chatFont.loadFromFile("C:/Windows/Fonts/arial.ttf");
        for (int i=0;i<20;i++) //load the chat window with fonts
        {
                chatText[i].setFont(chatFont);
                chatText[i].setCharacterSize(12);
                chatText[i].setColor(sf::Color::Black);
        }
        chatLineFocus = 19; //The client is focused on the very bottom line of text
        //...
}
//...
void Game::processEvents()
{
        //...
                case sf::Event::MouseWheelMoved:
                        if (event.mouseWheel.delta > 0) //mouse wheel up
                        {
                                if (chatLineFocus > 9)
                                {
                                        chatLineFocus--;
                                }
                        }
                        else //mouse wheel down
                        {
                                if (chatLineFocus < 19)
                                        chatLineFocus++;
                        }
                        break;
        //...
        dataPacketFrom.clear();
        if (socketStatus == sf::Socket::Done) //only check if we're connected
        {
                if (socket.receive(dataPacketFrom) != sf::Socket::NotReady)
                {
                        //if there is data available this will return something other than NotReady
                        std::string str_in;
                        dataPacketFrom >> str_in;
                        pushMessage(str_in);
                }
        }
        //...
}
//...
void Game::render()
{
        mWindow.clear();
        //...

        //draw the chatbox
        sf::RectangleShape chatBox(sf::Vector2f(580.f,175.f)); //create a white rectangle
        sf::RectangleShape chatInput(sf::Vector2f(580.f,40.f)); //create another white rectangle

        //position and fill the boxes
        chatBox.setFillColor(sf::Color(255,255,255,125));
        chatBox.setPosition(700.f,545.f);
        chatInput.setFillColor(sf::Color(255,255,255,125));
        chatInput.setPosition(700.f,680.f);

        mWindow.draw(chatBox);
        mWindow.draw(chatInput);
        for (int i = 0; i < 9; i++)
        {
                //draw each of the 9 "visible" texts
                chatText[chatLineFocus - (8 - i)].setPosition(705.f, 550.f + (13.f * float(i)));
                mWindow.draw(chatText[chatLineFocus - (8 - i)]);
                temp2 = chatText[chatLineFocus - (8 - i)].getString().toAnsiString();
                temp = chatText[chatLineFocus - (8 - i)].getPosition();
        }
        mWindow.draw(currentInput);
        //...
        mWindow.display();
}
//here's where it gets ugly...
void Game::pushMessage(std::string str_in, sf::Color color)
{
        unsigned int i;
        sf::String lastLine;
        sf::Glyph glyph; //used for calculating line length
        int lineSize = 0; //used to determine when a line would run off the page
        int lastSpace = -1; //used to keep track of the last space in a line

        for (i=1;i<20;i++)
                chatText[i-1] = chatText[i]; //shift all the messages down to accept a new message
        chatText[19].setString(sf::String(str_in)); //put the new message in
        chatText[19].setColor(color);
       
        //break the most recent chat line up with line breaks
        lastLine = chatText[19].getString();
        for (i = 0; i < lastLine.getSize(); i++)
        {
                glyph = chatFont.getGlyph(lastLine[i],chatText[0].getCharacterSize(),false); //get the current character
                if ((lineSize + glyph.advance) > 570) //check for runoff
                {
                        for (i=1;i<20;i++)
                                chatText[i-1] = chatText[i]; //shift all the messages down again
                        if (lastSpace != -1)
                        {
                                chatText[18].setString(lastLine.toAnsiString().substr(0,lastSpace));//put the first part of the string up a line
                                chatText[19].setString(lastLine.toAnsiString().substr(lastSpace+1));//put the remainder back into slot 19
                        }
                        else
                        {
                                chatText[18].setString(lastLine.toAnsiString().substr(0,i));//put the first part of the string up a line
                                chatText[19].setString(lastLine.toAnsiString().substr(i));//put the remainder back into slot 19
                        }
                        lastLine = chatText[19].getString(); //reset our tracking string and start over to see if this new line is long
                        lastSpace = -1;
                        i=0; //reset our counter
                        lineSize = 0; //reset our line counter
                }
                else
                        lineSize += glyph.advance; //increment linesize by the texture size of the current character
                if (lastLine[i] == '\n')
                        lineSize = 0;
                if (lastLine[i] == ' ')
                        lastSpace = i;
        }
}

 

The other problem I have is that the user's text input just keeps going right off the edge of the screen, I'd like to simply shift the text over so that the text is still visible, but I can't figure out how to do that using an sf::Text.

I've searched around and looked at the way some other people implement things, and it seems like other people's code does way more things than I need it to (like SFGUI and TGUI) or they're dead projects that aren't fully implemented (SFChat and TextArea).

Here's a screenshot of what it looks like when it's running:


Any thoughts on how I could make this be a bit more elegant?

23
General / Re: Can't get SFML 2.1 to work in Visual Studio 2012
« on: October 21, 2013, 04:12:57 am »
Thanks, here's the verbose output:

Code: [Select]
1>------ Build started: Project: Brand New Project, Configuration: Debug Win32 ------
1>  Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1>  cl /c /I"C:\SFML-2.1-windows-vc11-32bits\SFML-2.1\include" /ZI /nologo- /W3 /WX- /sdl /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt Main.cpp
1>cl : Command line warning D9035: option 'nologo-' has been deprecated and will be removed in a future release
1> 
1>  Skipping... (no relevant changes detected)
1>  Main.cpp
1>  Microsoft (R) Incremental Linker Version 11.00.60610.1
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1>  "/OUT:c:\users\xxx laptop\documents\visual studio 2012\Projects\Brand New Project\Debug\Brand New Project.exe" /INCREMENTAL "/LIBPATH:C:\SFML-2.1-windows-vc11-32bits\SFML-2.1\lib" "sfml-audio-d.lib" "sfml-graphics-d.lib" "sfml-main-d.lib" "sfml-network-d.lib" "sfml-system-d.lib" "sfml-window-d.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:c:\users\xxx laptop\documents\visual studio 2012\Projects\Brand New Project\Debug\Brand New Project.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:c:\users\xxx laptop\documents\visual studio 2012\Projects\Brand New Project\Debug\Brand New Project.lib" /MACHINE:X86 Debug\Main.obj
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glColorPointer@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDepthMask@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDisableClientState@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glEnableClientState@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glFrustum@48 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glVertexPointer@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _main
1>c:\users\xxx laptop\documents\visual studio 2012\Projects\Brand New Project\Debug\Brand New Project.exe : fatal error LNK1120: 17 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm not using the convenience header, since the project wasn't working at all with it in there. I'm using SFML 2.1 downloaded from here: http://www.sfml-dev.org/download/sfml/2.1/ a few hours ago, version Visual C++ 11 (2012) - 32 bits.

24
General / Re: Can't get SFML 2.1 to work in Visual Studio 2012
« on: October 21, 2013, 12:38:51 am »
I can sure try:







Let me know if there's any other pictures that might help.

Also, this is kind of weird, but to take these screen shots I started a brand new project, following all the tutorial steps, and now I'm only getting 17 linker errors instead of the 81 that I was getting above. I'm almost positive that I did every step exactly the same too.

25
General / Re: Can't get SFML 2.1 to work in Visual Studio 2012
« on: October 21, 2013, 12:20:53 am »
Forgot to mention that I followed the official 2.1 tutorial and had the same results, which is why I looked elsewhere for a tutorial. Here's the 81 errors I get when I follow the http://www.sfml-dev.org/tutorials/2.1/start-vc.php tutorial:

1>------ Build started: Project: Default, Configuration: Debug Win32 ------
1>sfml-graphics-s-d.lib(Color.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(RenderWindow.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Shape.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(CircleShape.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(RenderStates.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Transform.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(View.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Texture.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(GLCheck.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Image.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(Transformable.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(VertexArray.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(TextureSaver.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-system-s-d.lib(String.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-system-s-d.lib(Err.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(VideoMode.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(Window.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(VideoModeImpl.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(GlContext.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(WindowImpl.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(JoystickManager.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) already defined in libcpmtd.lib(stdthrow.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in Source.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in Source.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in Source.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) already defined in libcpmtd.lib(xthrow.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmtd.lib(xthrow.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmtd.lib(xthrow.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::locale::id::id(unsigned int)" (??0id@locale@std@@QAE@I@Z) already defined in Source.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z) already defined in libcpmtd.lib(syserror.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@YAPBDH@Z) already defined in libcpmtd.lib(syserror.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in libcpmtd.lib(locale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBE_JXZ) already defined in libcpmtd.lib(locale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" (?width@ios_base@std@@QAE_J_J@Z) already defined in libcpmtd.lib(locale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in libcpmtd.lib(locale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::locale::id::operator unsigned int(void)" (??Bid@locale@std@@QAEIXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in libcpmtd.lib(locale0.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: bool __thiscall std::codecvt_base::always_noconv(void)const " (?always_noconv@codecvt_base@std@@QBE_NXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::in(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (?in@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::out(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (?out@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: int __thiscall std::codecvt<char,char,int>::unshift(int &,char *,char *,char * &)const " (?unshift@?$codecvt@DDH@std@@QBEHAAHPAD1AAPAD@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: static unsigned int __cdecl std::codecvt<char,char,int>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::eback(void)const " (?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const " (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::pptr(void)const " (?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::egptr(void)const " (?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::epptr(void)const " (?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Gndec(void)" (?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Gninc(void)" (?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(char * *,char * *,int *,char * *,char * *,int *)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: __thiscall std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (?_Init@locale@std@@CAPAV_Locimp@12@_N@Z) already defined in libcpmtd.lib(locale0.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: wchar_t __thiscall std::ctype<wchar_t>::widen(char)const " (?widen@?$ctype@_W@std@@QBE_WD@Z) already defined in libcpmtd.lib(wlocale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: char __thiscall std::ctype<wchar_t>::narrow(wchar_t,char)const " (?narrow@?$ctype@_W@std@@QBED_WD@Z) already defined in libcpmtd.lib(wlocale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: static unsigned int __cdecl std::ctype<wchar_t>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z) already defined in libcpmtd.lib(wlocale.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in libcpmtd.lib(cout.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in libcpmtd.lib(cout.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __CrtDbgReportW already defined in LIBCMTD.lib(dbgrptw.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memcpy_s already defined in LIBCMTD.lib(memcpy_s.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fgetc already defined in LIBCMTD.lib(fgetc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fgetpos already defined in LIBCMTD.lib(fgetpos.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fputc already defined in LIBCMTD.lib(fputc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fsetpos already defined in LIBCMTD.lib(fsetpos.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __fseeki64 already defined in LIBCMTD.lib(fseeki64.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _setvbuf already defined in LIBCMTD.lib(setvbuf.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _ungetc already defined in LIBCMTD.lib(ungetc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __lock_file already defined in LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: __unlock_file already defined in LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _memchr already defined in LIBCMTD.lib(memchr.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _ldexp already defined in LIBCMTD.lib(ldexp.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _feof already defined in LIBCMTD.lib(feoferr.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _tolower already defined in LIBCMTD.lib(tolower.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _wcslen already defined in LIBCMTD.lib(wcslen.obj)
1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>sfml-system-s-d.lib(ThreadLocal.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in Source.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

26
General / Can't get SFML 2.1 to work in Visual Studio 2012
« on: October 21, 2013, 12:03:35 am »
Hi,

Im brand new to SFML, and I can't figure it out. I tried following this tutorial to get everything set up:

http://www.cplusplus.com/forum/beginner/95295/#msg511542

I followed it to the letter (except for the Doxygen part), and I'm getting 31 unresolved externals linking errors.

First, I created a brand new blank c++ project. I put examples/window/window.cpp into the project and tried to build:

1>  Source.cpp
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Time::asSeconds(void)const " (__imp_?asSeconds@Time@sf@@QBEMXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Clock::Clock(void)" (__imp_??0Clock@sf@@QAE@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Time __thiscall sf::Clock::getElapsedTime(void)const " (__imp_?getElapsedTime@Clock@sf@@QBE?AVTime@2@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function _main
1>Source.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>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main
1>Source.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>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::close(void)" (__imp_?close@Window@sf@@QAEXXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QBE_NXZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Vector2<unsigned int> __thiscall sf::Window::getSize(void)const " (__imp_?getSize@Window@sf@@QBE?AV?$Vector2@I@2@XZ) referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::setActive(bool)const " (__imp_?setActive@Window@sf@@QBE_N_N@Z) referenced in function _main
1>Source.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>Source.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glColorPointer@16 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glDepthMask@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glDisableClientState@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glEnableClientState@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glFrustum@48 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glVertexPointer@16 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _main
1>c:\users\xxx\documents\visual studio 2012\Projects\Default\Debug\Default.exe : fatal error LNK1120: 31 unresolved externals
 

As I said above, I followed the tutorial exactly, with linking to the correct folders for both Includes and Libraries, and it doesn't work.

I also tried just using the VisualC++11 (32 bit) download straight from the SFML page in case I didn't configure cmake properly, and I'm getting the exact same errors.

Secondly, and slightly less important, the tutorial I linked to above has you create a convenience header:
//sfml.h
#pragma once
#ifndef SFMLFULL_INCLUDED
#define SFMLFULL_INCLUDED
 
#define SFML_STATIC
 
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
 
#if defined(_DEBUG) || defined(DEBUG)
    #pragma comment(lib,"sfml-graphics-s-d.lib")
    #pragma comment(lib,"sfml-audio-s-d.lib")
    #pragma comment(lib,"sfml-network-s-d.lib")
    #pragma comment(lib,"sfml-window-s-d.lib")
    #pragma comment(lib,"sfml-system-s-d.lib")
    #pragma comment(lib,"sfml-main-d.lib")
#else
    #pragma comment(lib,"sfml-graphics-s.lib")
    #pragma comment(lib,"sfml-audio-s.lib")
    #pragma comment(lib,"sfml-network-s.lib")
    #pragma comment(lib,"sfml-window-s.lib")
    #pragma comment(lib,"sfml-system-s.lib")
    #pragma comment(lib,"sfml-main.lib")
#endif
 
 
#endif // SFMLFULL_INCLUDED

When I try and include the convenience header, I get errors like this:
1>c:\users\xxx\documents\visual studio 2012\projects\default\default\source.cpp(24): error C3861: 'glClearDepth': identifier not found
1>c:\users\xxx\documents\visual studio 2012\projects\default\default\source.cpp(25): error C3861: 'glClearColor': identifier not found
1>c:\users\xxx\documents\visual studio 2012\projects\default\default\source.cpp(28): error C2065: 'GL_DEPTH_TEST' : undeclared identifier
1>c:\users\xxx\documents\visual studio 2012\projects\default\default\source.cpp(28): error C3861: 'glEnable': identifier not found
1>c:\users\xxx\documents\visual studio 2012\projects\default\default\source.cpp(29): error C2065: 'GL_TRUE' : undeclared identifier
...
 
As if the compiler doesn't include any of the .h files that sfml.h says to include (but I don't get any errors in sfml.h itself.

So to get the link errors that I'm getting above, I have to use the includes exactly as they are written in the example.

Please help, I have no idea where to start, google searching for these terms turns up pages talking about linking to the correct libraries, but I thought that's what I already did when I told the project to use library directories .../lib/release and .../lib/debug?

Thanks!

(I'm using MS VisualStudio 2012 Update 2 V11.0.60315.01 running in Windows 7 Profession 64 bit)

Pages: 1 [2]