Sorry for the late reply just got home work.
Thanks for your contribution @TheEqualizer that gives me good hints to look for.
After some researches I learnt that these types are defined in the SDK 10.0.
Both my projects are using SDK 10.0 so the problem is somewhere else.
From [Hidden Content]
It states : Header : minwindef.h (include Windows.h (there is a typo it states Windows.h whereas it is actually windows.h)
It is defined in minwindef.h :
typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
So I have tried checking from a VS2022 project that compiles where this header would be included :
- main.cc of libpoly
- loadlib.c from liblua
- stdafx.h from libthecore
From my VS2019 project (Avenor2 server sources) It is included at the exact same places + typedef.h that includes wndows.h.
Could it be an issue where a library is compiled in the wrong order ? I have tried including windows.h from the main of game project (VS2019 project) as a test (I assumed it would atleast give me a different build result as the entire game project would have that header included) but it doesn't change anything.
I believe simply putting this define might be a work-around but I wonder if that it is just going to move the problem elsewhere (if the header is not loaded maybe an entire lib is not loaded or something similar which would lead to server crash).
Any ideas I didn't think of to figure this out ? I have compared project references, includes, build orders and dependencies and they both have similar settings (VS2019 / VS2022). Only noticeable difference is the GCC version used which I don't expect to be the reason of the issue here.
Edit : this piece of code from liblua/src/lib/loadlib.c (VS2019 project) might be useful
/*
** In Windows, default is to use dll; otherwise, default is not to use dll
*/
#ifndef USE_DLL
/*
** In Windows, default is to use dll; otherwise, default is not to use dll
*/
#ifndef USE_DLL
#ifdef _WIN32
#define USE_DLL 1
#else
#define USE_DLL 0
#endif
#endif
#if USE_DLL
#define LOADLIB
/*
* This is an implementation of loadlib for Windows using native functions.
*/
#include <windows.h>
Thanks !