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

Author Topic: migration-problem 3.0.0 threadid  (Read 349 times)

0 Members and 2 Guests are viewing this topic.

HeinzK

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ZwiAner
    • Email
migration-problem 3.0.0 threadid
« on: January 02, 2025, 12:03:32 pm »
I am in the process of migrating my program from SFML2.6.2 to SMF3.0.0.
I don't know what to do about my first problem. Can anyone help me?

Fehler (aktiv)   E0337   Die Bindungsspezifikation ist mit ""__threadid" (deklariert in Zeile 55 von "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h")" (vorherig) inkompatibel.   
ZwiAner   C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h   55      

//> from the stddef.h:
_ACRTIMP extern unsigned long  __cdecl __threadid(void);
#define _threadid (__threadid())
_ACRTIMP extern uintptr_t __cdecl __threadhandle(void);

//> My Headers:
//> SFML:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Network.hpp>
//> Windows:
#define NOMINMAX
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ctime>
#include <ccomplex>
#include <direct.h>
#include <io.h>
#include <tchar.h>
#include <mmsystem.h>
#include <cstdlib>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>
#include <memory.h>
#include <malloc.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <map>
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11073
    • View Profile
    • development blog
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #1 on: January 02, 2025, 02:10:18 pm »
Make sure you're doing a clean rebuild - you may even need to delete some obj files manually.
Does the error show both places where __threadid is declared?
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HeinzK

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ZwiAner
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #2 on: January 02, 2025, 03:45:13 pm »
.. I had deleted x64/debug by hand .. only this line is displayed: The binding specification is incompatible with “”__threadid” (declared in line 55 of ‘C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h’)” (previously) incompatible
.. a second error is displayed: The binding specification is incompatible with “”__threadhandle” (declared in line 57 of ‘C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stddef.h’)” (previously) incompatible
.. there are 100 other problems, for example:
1>E:\KEMPTER\SFML\VC17\_SFML3\_Win64\SFML-3.0.0\include\SFML\Graphics\Color.inl(75,17): error C3615: Die constexpr-Funktion "sf::operator +" kann keinen konstanten Ausdruck ergeben.
constexpr Color operator+(Color left, Color right)
{
    const auto clampedAdd = [](std::uint8_t lhs, std::uint8_t rhs)
    {
        const int intResult = int{lhs} + int{rhs};
        return static_cast<std::uint8_t>(intResult < 255 ? intResult : 255);
    };

    return {clampedAdd(left.r, right.r),
            clampedAdd(left.g, right.g),
            clampedAdd(left.b, right.b),
            clampedAdd(left.a, right.a)};
}
.. but one thing at a time, please help
.. Note: under 2.6.2 the compilation runs without problems
.. Microsoft Visual Studio Community 2022 (64-Bit) - Current Version 17.12.3
.. Microsoft .NET Framework Version 4.8.09037
« Last Edit: January 02, 2025, 05:44:04 pm by HeinzK »
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

HeinzK

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ZwiAner
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #3 on: January 03, 2025, 05:26:09 pm »
The following observation:
when I change the 'additional includes' from 2.6.2 to 3.0.0, the content of CMATH changes:

.. and the following error message appears:
Fehler(aktiv) E0135 "Namespace "std"" hat keinen Member ""enable_if_t"".   
ZwiAner   C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include\cmath   566
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11073
    • View Profile
    • development blog
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #4 on: January 03, 2025, 11:12:18 pm »
Do you have C++17 enabled?
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HeinzK

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ZwiAner
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #5 on: January 04, 2025, 09:04:04 am »
I work with:
.. Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.12.3
.. Microsoft .NET Framework Version 4.8.09037 and SFML 2.6.2.
Everything has worked so far. I have only changed the 'Additional include directories' from 2.6.2 to 3.0.0.
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11073
    • View Profile
    • development blog
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #6 on: January 05, 2025, 11:38:39 pm »
I just tested a basic migration locally with VS 2022 and didn't run into any issues.

When upgrading from SFML 2.6.2 to 3.0.0 the only things I changed were:
  • Additional include directories - to point to the SFML 3 include directory
  • Additional library directories - to point to the SFML 3 lib directory
  • Change the language from C++14 to C++17
  • Update the SFML code according to the migration guide

This didn't cause any issues.

Do you use precompiled headers?
Are your general settings the same as mine?

Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HeinzK

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ZwiAner
    • Email
Re: migration-problem 3.0.0 threadid
« Reply #7 on: January 06, 2025, 08:50:49 am »
Microsoft Visual Studio Community 2022 (64-Bit) - Current
Version 17.12.3 .. my mistake .. I was of the opinion that this 17 was meant ..
.. now it's time for the finer details .. thanks for the help.
The trees, that obstruct the view on the forest, can be allowed to fall! (Die Bäume, die die Sicht auf einen Wald versperren, dürfen gefällt werden!)

 

anything