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

Pages: [1]
1
I have compiled SFML 2.3.1 for Visual Studio 2015 Community.

It gives me these errors:

Code: [Select]
1>flac.lib(stream_decoder.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _FLAC__stream_decoder_reset
1>flac.lib(stream_encoder.obj) : error LNK2001: unresolved external symbol ___iob_func
1>flac.lib(win_utf8_io.obj) : error LNK2001: unresolved external symbol ___iob_func
1>flac.lib(bitreader.obj) : error LNK2019: unresolved external symbol _fprintf referenced in function _FLAC__bitreader_dump
1>flac.lib(bitwriter.obj) : error LNK2001: unresolved external symbol _fprintf
1>flac.lib(win_utf8_io.obj) : error LNK2019: unresolved external symbol _vsnprintf_s referenced in function _local_vsnprintf
1>msvcrtd.lib(vsnprintf_s.obj) : error LNK2001: unresolved external symbol _vsnprintf_s
1>msvcrtd.lib(vsnprintf_s.obj) : error LNK2001: unresolved external symbol __vsnprintf_s

Has anyone successfully compiled SFML 2.3.1 for Visual Studio 2015?

Though, the errors do relate to flac.lib and msvcrtd.lib, which aren't part of SFML.

Anyone have a solution for my problem?

Update...

Compiling libFLAC from http://sourceforge.net/projects/libzplay/ gives me these errors instead:

Code: [Select]
1>msvcrtd.lib(initializers.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>flac.lib(stream_decoder.obj) : error LNK2019: unresolved external symbol _fseeko referenced in function _file_seek_callback_
1>flac.lib(stream_encoder.obj) : error LNK2001: unresolved external symbol _fseeko
1>flac.lib(stream_decoder.obj) : error LNK2019: unresolved external symbol _ftello referenced in function _file_tell_callback_
1>flac.lib(stream_encoder.obj) : error LNK2001: unresolved external symbol _ftello

Update 2...

The _fseeko and _ftello stuff was defined for older versions of Visual Studio (in FLAC source code), but not for 2015. So I moved them around to make them defined.

Not sure if this is progress or not. Now I'm getting this:

Code: [Select]
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_new referenced in function "public: static bool __cdecl sf::priv::SoundFileReaderFlac::check(class sf::InputStream &)" (?check@SoundFileReaderFlac@priv@sf@@SA_NAAVInputStream@3@@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_delete referenced in function "public: static bool __cdecl sf::priv::SoundFileReaderFlac::check(class sf::InputStream &)" (?check@SoundFileReaderFlac@priv@sf@@SA_NAAVInputStream@3@@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_get_state referenced in function "public: virtual unsigned __int64 __thiscall sf::priv::SoundFileReaderFlac::read(short *,unsigned __int64)" (?read@SoundFileReaderFlac@priv@sf@@UAE_KPAF_K@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_init_stream referenced in function "public: static bool __cdecl sf::priv::SoundFileReaderFlac::check(class sf::InputStream &)" (?check@SoundFileReaderFlac@priv@sf@@SA_NAAVInputStream@3@@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_finish referenced in function "public: static bool __cdecl sf::priv::SoundFileReaderFlac::check(class sf::InputStream &)" (?check@SoundFileReaderFlac@priv@sf@@SA_NAAVInputStream@3@@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_process_single referenced in function "public: virtual unsigned __int64 __thiscall sf::priv::SoundFileReaderFlac::read(short *,unsigned __int64)" (?read@SoundFileReaderFlac@priv@sf@@UAE_KPAF_K@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_process_until_end_of_metadata referenced in function "public: static bool __cdecl sf::priv::SoundFileReaderFlac::check(class sf::InputStream &)" (?check@SoundFileReaderFlac@priv@sf@@SA_NAAVInputStream@3@@Z)
1>sfml-audio-s-d.lib(SoundFileReaderFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_decoder_seek_absolute referenced in function "public: virtual void __thiscall sf::priv::SoundFileReaderFlac::seek(unsigned __int64)" (?seek@SoundFileReaderFlac@priv@sf@@UAEX_K@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_new referenced in function "public: virtual bool __thiscall sf::priv::SoundFileWriterFlac::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?open@SoundFileWriterFlac@priv@sf@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_delete referenced in function "private: void __thiscall sf::priv::SoundFileWriterFlac::close(void)" (?close@SoundFileWriterFlac@priv@sf@@AAEXXZ)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_set_channels referenced in function "public: virtual bool __thiscall sf::priv::SoundFileWriterFlac::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?open@SoundFileWriterFlac@priv@sf@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_set_bits_per_sample referenced in function "public: virtual bool __thiscall sf::priv::SoundFileWriterFlac::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?open@SoundFileWriterFlac@priv@sf@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_set_sample_rate referenced in function "public: virtual bool __thiscall sf::priv::SoundFileWriterFlac::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?open@SoundFileWriterFlac@priv@sf@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_init_file referenced in function "public: virtual bool __thiscall sf::priv::SoundFileWriterFlac::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?open@SoundFileWriterFlac@priv@sf@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II@Z)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_finish referenced in function "private: void __thiscall sf::priv::SoundFileWriterFlac::close(void)" (?close@SoundFileWriterFlac@priv@sf@@AAEXXZ)
1>sfml-audio-s-d.lib(SoundFileWriterFlac.obj) : error LNK2019: unresolved external symbol _FLAC__stream_encoder_process_interleaved referenced in function "public: virtual void __thiscall sf::priv::SoundFileWriterFlac::write(short const *,unsigned __int64)" (?write@SoundFileWriterFlac@priv@sf@@UAEXPBF_K@Z)

I should mention sfml-audio is the only part of SFML that I am currently using.

2
Audio / Re: Sounds working but exception (ntdll.dll) when closing game
« on: August 16, 2015, 12:35:56 pm »
And now I finally solved the issue using my original code.

I was lacking a destructor for my Game class (which initialized the Sound class).

Code: [Select]
Game::~Game()
{
sound.reset();
}

With this, I could completely remove the Sound destructor.

Thank you for pointing me in the right direction :)

3
Audio / Re: Sounds working but exception (ntdll.dll) when closing game
« on: August 16, 2015, 12:21:29 pm »
Hmmm. This presents a whole new problem with the buffer running out of scope when I create new buffers everywhere. So it's not really a solution for me, yet. All the tutorials around also only use the main function. Getting a sound to play there is simple.

Again, I tried declaring the sound buffer as a shared pointer to use in other classes:

Code: [Select]
std::shared_ptr<sf::SoundBuffer> soundBuffer;
And again, I get the same exception as before.

EDIT: I solved this problem by issuing the following after the game loop finishes:

Code: [Select]
soundBuffer.reset();

4
Audio / Re: Sounds working but exception (ntdll.dll) when closing game
« on: August 16, 2015, 11:54:33 am »
If I put this in main:

Code: [Select]
sf::SoundBuffer buffer;
sf::Sound sound;
if ( buffer.loadFromFile("wind.wav") )
sound.setBuffer(buffer);
sound.play();

It works.

I guess I'll have to rethink my Sound class or just not use it.

Thanks a lot!

5
Audio / Re: Sounds working but exception (ntdll.dll) when closing game
« on: August 16, 2015, 11:10:17 am »
Any chance the sf::SoundBuffer got destroyed before the sf::Sound causing the crash? Although I think that should be prevented already.

Show us some minimal code. :)

The code I provided in the link is pretty minimal? :)

These are the important parts I guess:

Code: [Select]
Sound::~Sound()
{
for ( auto &sound : sounds )
sound->stop();
}

std::shared_ptr<sf::Sound> Sound::load(const std::string &filename)
{
auto buffer = std::make_shared<sf::SoundBuffer>();
auto sound = std::make_shared<sf::Sound>();

if ( buffer->loadFromFile(filename) )
sound->setBuffer(*buffer);

buffers.push_back(buffer);
sounds.push_back(sound);

return sound;
}

I've tried destroying the buffers & sounds with the following code but it still throws an exception:

Code: [Select]
Sound::~Sound()
{
for ( auto &sound : sounds )
{
sound->stop();
sound.reset();
}

sounds.clear();
buffers.clear();
}

I might also add that when the exception is thrown, it shows me this code from <memory>:

Code: [Select]
virtual void _Destroy()
{ // destroy managed resource
_Getptr()->~_Ty();
}

6
Hello!

I've searched Google and looked through this forum for solutions to my problem, but to no avail. A few people have had issues with exceptions when quitting, but they don't seem to have the same problem I have.

I'm getting the following exception when quitting:

Code: [Select]
First-chance exception at 0x774F604C (ntdll.dll) in InSpace.exe: 0xC0000005: Access violation reading location 0xFEEEFEF6.
Unhandled exception at 0x774F604C (ntdll.dll) in InSpace.exe: 0xC0000005: Access violation reading location 0xFEEEFEF6.

My call stack looks like this:
Code: [Select]
InSpace.exe!std::_Ref_count_obj<sf::Sound>::_Destroy() Line 944 C++
  InSpace.exe!std::_Ref_count_base::_Decref() Line 118 C++
  InSpace.exe!std::_Ptr_base<sf::Sound>::_Decref() Line 344 C++
  InSpace.exe!std::shared_ptr<sf::Sound>::~shared_ptr<sf::Sound>() Line 611 C++
  InSpace.exe!std::shared_ptr<sf::Sound>::`scalar deleting destructor'(unsigned int) C++
  InSpace.exe!std::allocator<std::shared_ptr<sf::Sound> >::destroy<std::shared_ptr<sf::Sound> >(std::shared_ptr<sf::Sound> * _Ptr) Line 608 C++
  InSpace.exe!std::allocator_traits<std::allocator<std::shared_ptr<sf::Sound> > >::destroy<std::shared_ptr<sf::Sound> >(std::allocator<std::shared_ptr<sf::Sound> > & _Al, std::shared_ptr<sf::Sound> * _Ptr) Line 731 C++
  InSpace.exe!std::_Wrap_alloc<std::allocator<std::shared_ptr<sf::Sound> > >::destroy<std::shared_ptr<sf::Sound> >(std::shared_ptr<sf::Sound> * _Ptr) Line 879 C++
  InSpace.exe!std::_Destroy_range<std::_Wrap_alloc<std::allocator<std::shared_ptr<sf::Sound> > > >(std::shared_ptr<sf::Sound> * _First, std::shared_ptr<sf::Sound> * _Last, std::_Wrap_alloc<std::allocator<std::shared_ptr<sf::Sound> > > & _Al, std::_Nonscalar_ptr_iterator_tag __formal) Line 82 C++
  InSpace.exe!std::_Destroy_range<std::_Wrap_alloc<std::allocator<std::shared_ptr<sf::Sound> > > >(std::shared_ptr<sf::Sound> * _First, std::shared_ptr<sf::Sound> * _Last, std::_Wrap_alloc<std::allocator<std::shared_ptr<sf::Sound> > > & _Al) Line 96 C++
  InSpace.exe!std::vector<std::shared_ptr<sf::Sound>,std::allocator<std::shared_ptr<sf::Sound> > >::_Destroy(std::shared_ptr<sf::Sound> * _First, std::shared_ptr<sf::Sound> * _Last) Line 1567 C++
  InSpace.exe!std::vector<std::shared_ptr<sf::Sound>,std::allocator<std::shared_ptr<sf::Sound> > >::_Tidy() Line 1628 C++
  InSpace.exe!std::vector<std::shared_ptr<sf::Sound>,std::allocator<std::shared_ptr<sf::Sound> > >::~vector<std::shared_ptr<sf::Sound>,std::allocator<std::shared_ptr<sf::Sound> > >() Line 946 C++
  InSpace.exe!Sound::~Sound() Line 7 C++
  [External Code]

I am using SFML version 2.3.1 on Visual Studio 2013.

I am using SFML_STATIC in preprocessor definitions.

I have included the dependencies in the following order:
sfml-audio-s-d.lib
sfml-system-s-d.lib
winmm.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

I am using the -s versions for the release.

openal32.dll is placed in the project directory.

I should also note that I am only using SFML's sound engine. This is due to the game being a school project where we are supposed to learn the Win32 windows handling stuff (C++).

This is my code: http://paster.se/XECd6

Can you spot any obvious errors?

Pages: [1]
anything