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

Pages: [1] 2
1
A bit more additional info:
- I switched over to my Ubuntu box, and, using all the same settings (what to link, dynamic vs static, etc), the only difference being the actual libraries compiled (64-bit Linux instead of Windows) ... it works just fine.
- I switched over to Code::Blocks on the Windows box, thinking that maybe VS2010 was doing something weird. Recompiled the libraries; linked everything the same way ... I get the same error. So it's not an IDE quirk; it's definitely something going wrong with Windows 7.

My best guess -- based on a lot of very general, "not sure what I'm looking for" Googling -- is that there's some mix-up going on between 32- and 64-bit, but ... I have no idea what, or where to even begin with that.

As far as I could tell, there aren't 64-bit-specific Windows libraries in the source.

Any ideas at all? I'll try anything at this point! I'm happy to develop on the Ubuntu box, but the added inconvenience is a pain  :lol:

2
So, some additional info -- it appears to be the actual linking that's causing the crash.

I took the simple tutorial example and tried building it without linking the library (and commenting out subsequent library calls). It ran!

However, linking the library (in this case, sfml-window-d.lib) causes this crash. Any ideas?

3
It wouldn't compile if that were the case -- I suffered through setting up linking and all that the first time :)

4
Just checked -- both are compiling in Win32 Debug mode.

5
Okay, so I tried the very simple Window example --

Code: [Select]
#include "stdafx.h"
#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;
}


Linking only sfml-window-d.lib (which I re-compiled on this machine), and using SFML_DYNAMIC.

Still gives me the same error!

6
Good question -- I'll try a simple SFML example tonight and see if it runs.

What I meant was that I think it is indeed a configuration error, as the code doesn't even start to run (stepping into the debugger, for example, or setting a breakpoint on the entry of main).

7
^^

Thanks for the effort anyway!

8
The code is ... quite large! Since I can't really narrow down the specific culprit, I can't really post it.

Someone in that thread suggested that his problem was a side-by-side with the .NET framework. Does SFML require a specific one? I didn't think it required .NET.

Edit: Another question -- are there pitfalls related to 64-bit that I should watch out for? I thought that if I just recompiled the current source on my 64-bit machine it should be fine.

9
So. My old development machine finally kicked the bucket. I'm on a new machine, a (somewhat) new environment, and trying to compile a program that worked just fine on the old machine on this new one.

The old machine was:
- Windows 7 basic (or whatever the very lowest version was)
- 32 bit
- Linking the static sfml2 libraries
- Using VS2010 express
- Worked like a champ!

The new machine is:
- Windows 7 ultimate
- 64 bit
- Linking the dynamic sfml2 libraries, which I re-compiled on this machine
- Still using VS2010 express
- Not working! :(

The program compiles just fine, but the second it starts, it crashes with the very helpful error message in the title.

Any ideas?

10
Audio / Passing sound buffers as references
« on: April 09, 2011, 11:01:53 pm »
LOL. /facepalm

Yes. Yes it should be. Thanks. :oops:

11
Network / Problem with using TCP connecting
« on: April 09, 2011, 08:27:38 pm »
Quote
Can it be caused that I dont have a public IP?


If I'm understanding the question right -- no. If you're connected to the internet, you have a public (outward-facing) IP address. You said earlier:

Quote
And my second question is why it doesnt work when I write the IP from whatismyip.com as ServerAddress.


That IP is your public IP. What Laurent is saying is that if you intend to use that IP address to connect, you need to forward ports. What's essentially happening (in a very small nutshell) is this:

- Your computer issues a request for 178.41.66.24.
- Your router says "That's outside our network!" and sends it off to a DNS service.
- The DNS service sends the packet to 178.41.66.24, which, as it happens, is your router.
- Your router gets it and says "Okay, which machine does this go to?" To answer that question, it looks at what port it's coming in on and its port forwarding rules. Every router has port forwarding rules.
- You provide (I'm assuming) port 4567 as the port. Your router looks at its port forwarding rules and says "I don't have a rule for this." Since it doesn't know where to send it, it drops the packet (unless it has some default rule defined).

It's easier to use your local IP address for testing, because you (usually) don't have to configure your router at all. If you're running it from the same machine, you can use localhost (127.0.0.1) as the IP address. If you're targeting a different machine on your network, you'll need its local address, which you can find by typing "ipconfig" in your command prompt (or "ifconfig" if you're using a Linux-based OS).

If you really, really want to use your public IP address, you'll have to Google the instructions for setting up port forwarding with your router (or use UPNP, but I wouldn't suggest that until you learn some basic networking!).

12
General / Unresolved linker externals
« on: April 09, 2011, 06:32:50 pm »
Just thought I'd note that I fixed it -- although I wish I was totally certain about what, exactly, I did!

When switching to static libs (and when switching to the multi-threaded debug runtime), I found that Visual Studio 2010 was keeping the wrong default libraries loaded -- I don't know if you're having the same problem I was, WitchD0ctor, but I had to specifically invoke the correct default libraries for my configuration, while specifically telling it to ignore the wrong ones, which it was previously using correctly.

You have to invoke different ones depending on which runtime you're using; make sure you're invoking the correct ones.

13
Audio / Passing sound buffers as references
« on: April 09, 2011, 06:25:05 pm »
So, I have a global resource manager. It has worked well with sprites so far, using the approach:
- Resource manager has sf::Image instances
- Any sprite that needs an image calls a reference to the appropriate sf::Image to use with SetImage

I tried doing the same with audio:
- Resource manager has sf::SoundBuffer instances, which load from files
- Any sf::Sound that needs to play first calls get_sound_buffer with the appropriate filename.

If I do this in main:
Code: [Select]
sf::SoundBuffer buf;
buf.LoadFromFile("Sounds\\Land.wav");
sf::Sound sound;
sound.SetBuffer(buf);
sound.Play();
while(sound.GetStatus() == sf::Sound::Status::Playing) { }


It works just fine.

However, when I try and use the resource manager:

Code: [Select]
file_cabinet.cpp:
(in the constructor) sound_map["ground_collide"].LoadFromFile("Sounds\\Land.wav");

sf::SoundBuffer &file_cabinet::get_sound_buffer(const std::string &Filename) {
    return sound_map[Filename];
}


(this is exactly the same as my get_image function, only replacing sf::Image with sf::SoundBuffers)

later, when I need to use a sound buffer:

Code: [Select]
sf::Sound sound;
sound.SetBuffer(file_cabinet.get_sound_buffer("Sounds\\Land.wav"));
sound.Play();
while(sound.GetStatus() == sf::Sound::Status::Playing) {}


wherever I need to invoke file_cabinet, I pass in a reference to the one file_cabinet object that exists, which is instantiated in main. This doesn't work -- there are no errors, but sounds do not play.

Is there something tricky I need to keep in mind for sound buffers?

14
Graphics / sf::priv::MutexImpl::Lock() Access Violation
« on: April 09, 2011, 09:38:34 am »
Aha! Before I upgraded, I was linking the dynamic files.

I've moved everything into main and it's working. Thanks!

15
Graphics / sf::priv::MutexImpl::Lock() Access Violation
« on: April 09, 2011, 01:18:55 am »
I updated my files from SFML 1.6 to 2.0. The program worked okay before; after making some necessary modifications because of the new code, my first run crashes.

Call stack:
Code: [Select]
ntdll.dll!76eb69e0()
  [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> Mindjob.exe!sf::priv::MutexImpl::Lock()  Line 52 + 0xc bytes C++
  Mindjob.exe!sf::Mutex::Lock()  Line 62 C++
  Mindjob.exe!sf::Lock::Lock(sf::Mutex & mutex)  Line 39 C++
  Mindjob.exe!sf::GlResource::GlResource()  Line 53 + 0xd bytes C++
  Mindjob.exe!sf::Image::Image()  Line 52 + 0x47 bytes C++
  Mindjob.exe!std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,sf::Image,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,sf::Image> > >::operator[](const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval)  Line 215 + 0xb bytes C++
  Mindjob.exe!mj_file_cabinet::mj_file_cabinet()  Line 7 + 0x3e bytes C++
  Mindjob.exe!`dynamic initializer for 'cabinet''()  Line 20 + 0x28 bytes C++
  Mindjob.exe!_initterm(void (void)* * pfbegin, void (void)* * pfend)  Line 873 C
  Mindjob.exe!_cinit(int initFloatingPrecision)  Line 288 + 0xf bytes C
  Mindjob.exe!__tmainCRTStartup()  Line 262 + 0x7 bytes C
  Mindjob.exe!wmainCRTStartup()  Line 189 C
  kernel32.dll!75a91194()
  ntdll.dll!76ecb429()
  ntdll.dll!76ecb3fc()


The code in question (if I'm reading the call stack right):

Code: [Select]
mj_file_cabinet::mj_file_cabinet() {
// load our images
// TODO: error handling
image_map["megaman"].LoadFromFile("Sprite Sheets\\x_cut.jpg");
image_map["platform_1"].LoadFromFile("Sprite Sheets\\platform_1.png");
image_map["platform_2"].LoadFromFile("Sprite Sheets\\platform_2.png");

//load our sounds
//TODO: error handling here too
sound_map["ground_collide"].LoadFromFile("Sounds\\Land.wav");
}


"image_map" is declared in the header as std::map<std::string, sf::Image>.

Any ideas?

Pages: [1] 2