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.


Topics - Kappa

Pages: [1]
1
So far, I am able to dynamically link SFML and run the executable just fine. However, statically linking the SFML errors saying:

Quote
sfml-graphics-s.lib(RenderWindow.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Main.o

My clang version and information are:
Quote
clang version 15.0.7
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: ...
which made me not accomplish any solutions from quick google search about my problem as their build system or environment is different from mine.

I downloaded the SFML version for Visual Studio 64 bit, and then setted up the required search directories and linkers such as sfml-graphics-s.lib.
My command line is:
clang++.exe -DSFML_STATIC -fms-extensions -O2 -Wnon-virtual-dtor -Wall -std=c++14 -I"Deps\SFML\include" -c "Main.cpp" -o "Main.o"

clang++.exe -L"Deps\SFML\lib" -o "Main.exe" "Main.o" -m64 -lfreetype.lib -lopengl32.lib -lwinmm.lib -lgdi32.lib -luser32.lib -lsfml-window.lib -lsfml-graphics-s.lib -lsfml-system.lib
 

2
Audio / Playing sound outside the main function doesn't work.
« on: November 13, 2022, 02:02:00 am »
I'm trying to make an audio manager that stores the pointers of sound buffer in a **map**.
Retrieving the sound buffer pointers and playing them works fine inside the main function.

But when you play a sound outside the main function, it doesn't. Even when the sound buffer still exists.

An example code that recreates this problem:

void say()
{
        sf::SoundBuffer buffer;
        buffer.loadFromFile("Assets/Audio/burp.wav");

        sf::Sound sound;
        sound.setBuffer(buffer);

        sound.play(); // Doesn't play the sound.
}

int main()
{
        say();
        // SFML window stuff...
}
 
   

Pages: [1]
anything