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

Pages: [1]
1
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 11:51:50 am »
I forgot to mention I also ran the makefile after the CMake GUI

2
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 11:30:17 am »
I did some more testing, and the problem seems to arise with the fact that LLVM downloaded directly from the website, uses MSVC, causing problems with linking and the runtime. Though I am not so sure why SFML is being marked as MD_DynamicRelease when it is static libraries. I tried using clang from MinGW, which uses GCC's standard library and that seems to work fine. I am not sure if this is an issue with MSVC or SFML, but it most likely seems to be an MSVC issue

3
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 11:01:18 am »
I did recompile SFML using the CMake GUI when I got that error, but regardless I tried recompiling SFML again with SFML_USE_STATIC_STD_LIBS on and BUILD_SHARED_LIBS off, and I am still getting the same linker error saying that the SFML static library has value MD_DynamicRelease. Also I checked and I am linking against the updated libraries

4
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 10:51:24 am »
Code: [Select]
lld-link: error: /failifmismatch: mismatch detected for 'RuntimeLibrary':
>>> C:\Users\\AppData\Local\Temp\test-af06e4.o has value MT_StaticRelease
>>> sfml-graphics-s.lib(CircleShape.cpp.obj) has value MD_DynamicRelease
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

5
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 10:29:40 am »
I tried compiling SFML with BUILD_SHARED_LIBS off and SFML_USE_STATIC_STD_LIBS on, but I am still getting the same linker error when trying to compile my code

6
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 10:25:31 am »
So does that mean that building with SFML_USE_STATIC_STD_LIBS will produce static libraries?

7
General / Re: Unable to link statically compiled SFML with clang
« on: November 08, 2024, 10:12:51 am »
But then wouldn't that make it produce dlls instead of static libraries?

8
General / Unable to link statically compiled SFML with clang MSVC
« on: November 08, 2024, 09:13:50 am »
I have statically compiled SFML 2.6.1 from source using LLVM 19 on Windows
When I try to compile my code, lld-link omits an error saying "mismatch detected for 'RuntimeLibrary'

I tried looking up fixes for this problem, but they all involve changing settings within Visual Studio and I do not want to use Visual Studio

Code Used:
#include "SFML/Graphics.hpp"

int main() {
    sf :: RenderWindow window(sf :: VideoMode(400, 400), "SFML works!");

    sf :: CircleShape shape(100.f);
    shape.setFillColor(sf :: Color :: Green);

    while (window.isOpen()){
        sf :: Event event;

        while (window.pollEvent(event)) {
            if (event.type == sf :: Event :: Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
};
 

Compile Command:
Code: [Select]
clang++ test.cpp -o test.exe -fuse-ld=lld-link -D SFML_STATIC -I "SFML-2.6.1\include" -L "SFML-2.6.1\build\lib" -l sfml-graphics-s -l sfml-window-s -l sfml-system-s -l opengl32 -l winmm -l gdi32

Error:
Code: [Select]
lld-link: error: /failifmismatch: mismatch detected for 'RuntimeLibrary':
>>> C:\Users\\AppData\Local\Temp\test-db37c8.o has value MT_StaticRelease
>>> sfml-graphics-s.lib(CircleShape.cpp.obj) has value MD_DynamicRelease
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

9
General / Re: Unable to run statically compiled SFML with GCC
« on: November 08, 2024, 08:53:01 am »
I figured it out, I just had to add
Code: [Select]
-static-libstdc++ -static flags to my compile command, thanks

10
General / Re: Unable to run statically compiled SFML with GCC
« on: November 08, 2024, 08:46:48 am »
I ran the executable from explorer and it said it could not find libgcc_s_seh-1.dll and libstdc++-6.dll, I found the libgcc dll but I cannot find the stdc++ dll with the -6 prefix at the end, only one without it within MinGW. I tried to link against the dll but Windows still says it cannot find that dll

11
General / [Solved] Unable to run statically compiled SFML with GCC
« on: November 08, 2024, 08:30:22 am »
I have compiled SFML statically using GCC 13.1.0 from winlibs MinGW64
When I compile my source code, no errors are omitted, but when I go to run the executable, it exits with an error but there is no output

I have tried using the precompiled libraries from the SFML release, but it produces the same result

Code Used:
#include "SFML/Graphics.hpp"

int main() {
    sf :: RenderWindow window(sf :: VideoMode(200, 200), "SFML works!");

    sf :: CircleShape shape(100.f);
    shape.setFillColor(sf :: Color :: Green);

    while (window.isOpen()){
        sf :: Event event;

        while (window.pollEvent(event)) {
            if (event.type == sf :: Event :: Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
};
 

Compile Command:
Code: [Select]
g++ test.cpp -o test.exe -D SFML_STATIC -I SFML-2.6.1\include -L SFML-2.6.1\build\lib -l sfml-graphics-s -l sfml-window-s -l sfml-system-s -l opengl32 -l winmm -l gdi32

Pages: [1]