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

Author Topic: Building SFML 2.0-rc for use with VS2012  (Read 6403 times)

0 Members and 1 Guest are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Building SFML 2.0-rc for use with VS2012
« Reply #15 on: March 16, 2013, 06:39:15 pm »
What are you trying to compile then?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #16 on: March 16, 2013, 07:16:05 pm »
#include <SFML/System.hpp>
#include <iostream>

int main()
{
        sf::Clock clock;


        while (true)
        {
                if (clock.getElapsedTime().asSeconds() > 2)
                {
                        clock.restart();

                        std::cout << "Hello world!\n";
                }
        }
}
 

There used to be creating a TcpSocket and Sound in there as well, but this is the simple part. Still errors.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #17 on: March 16, 2013, 07:46:56 pm »
Everything works fine on my system.

So you either have made some changes, we couldn't find out on your system, or your Visual Studio installation is corrupt. Have you tried reinstalling VS? :-\
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #18 on: March 17, 2013, 02:41:32 pm »
Any idea what those changes could be? I would hope to not do that as I feel it would leave something behind, and the download took... a long time. And then the installation.

Anyway, asked over on Stack Overflow, no answers. Not sure what to try next. I wouldn't think VS would be currupt in seemingly just this case (works fine otherwise). I have no idea what the settings would be, though, however I don't think anything is wrong with the libraries, I think it is more of linking to them. Yet,the linker settings seem perfect, so I don't know what to look at.

chessguy

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Building SFML 2.0-rc for use with VS2012
« Reply #19 on: April 07, 2013, 01:09:04 am »
Ok. I had resorted to using C::B again, but the lack of intellisense, among other things - well, I realized, those things are incredibly helpful to my productivity.

That being said, I still have no idea what the problem is. I decided to scrap it, and try to restart. Note that this included reinstalling VS, and it wasn't the problem. (after uninstalling, that is). So, a corrupt install is not the issue at play here.

I decided to try dynamic first. If I can get that to work, then I might try static, but not untill then. (and if one works, both should, in theory). Here are the details:

I am using the Visual 11 win64 build, from the unofficial nightly builds, to rule out my building the libs incorrectly.

I decided to just include both that, and the entire project file, which would have the source, paths, and what have you, which should help resolve... about everything, I think. This is here: http://www.mediafire.com/?6869f117dqsrudt.

Assuming it is not the paths, and not the libs, what could it be? As I said (I think), I am on Windows 7, 64-bit.  Perhaps using the 64-bit is incorrect (the nightly build), for whatever reason. Any ideas on this? I really, really, want to get this to work. Both for making games, and as a windowing utility for openGL. And input. And, say, even sound. As far as I see, it really is the best thing to use, in this case.

EDIT: the error would probably helpful, wouldn't it?

Error   1   error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Time::asSeconds(void)const " (__imp_?asSeconds@Time@sf@@QBEMXZ) referenced in function _main   

There are two others that are the same but about different aspects of the time or clock objects.
« Last Edit: April 07, 2013, 01:13:40 am by chessguy »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Building SFML 2.0-rc for use with VS2012
« Reply #20 on: April 07, 2013, 03:16:04 pm »
Okay so I've taken a look at your project file and found two important mistakes:

  • You're trying to link x64 libraries, but you've specified to us the x86 compiler. Visual Studio 2012 (> Express) ships with a x86 and a x64 compiler. If you want to change it, then you'll have to change the compiler. Usually you can find a dropdown box next to the "Debug/Release" mode changer, which has by default "Win32" writtin in it. You'll now have to manually add the new compiler and you'll have to readjust the project settings.
  • You've in "Code Generation" set the "Runtime Library" to /MTd, which is incompatible with the /MDd flag SFML is build. You can link the runtime library statically (/MTd) only if you link SFML statically (see the lib/std-static directory from the nightly build).

After changing those two settings, the application complied, although the code within Main.cpp doesn't make much sense.
if (clock.getElapsedTime().asSeconds()) ;
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything