Jump to content

huntmaster

Inactive Member
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

About huntmaster

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

huntmaster's Achievements

Rookie

Rookie (2/16)

  • Week One Done
  • Dedicated
  • First Post
  • Conversation Starter
  • Reacting Well

Recent Badges

0

Reputation

  1. Why would I not ? Didn't feel like starting from scratch to re implement everything that exists and has already been implemented ... At this point It's more about fixing those sources than anything else lol After a bunch of hours looking into the code, I have found where my type get lost in the code : game/src/utils.h inline uint16_t MAKEWORD(BYTE a, BYTE b) { return static_cast<uint16_t>(a) | (static_cast<uint16_t>(b) << 8); } When I get this commented I jump from 5k+ errors to 300ish. I don't quite understand why is that so if someone could explain I would appreciate !
  2. Sorry for double post but for some reason I am unable to edit my previous one. Update : The type WORD is not recognized at the very beginning of my main (VS2019) whereas it is on the VS2022 project which means that from the very beginning of game compilation word is not defined as an unsigned short. For test purposes here is my main.cpp (game) : int main(int argc, char** argv) { ilInit(); DWORD test_var; // DWORD is recognised as typedef unsigned long QWORDZZZ test_var3; // QWORDZZZ is recognised as unsigned short WORD test_var2; // WORD is recognised as WORD(<error-type>) ... } Here is my typedef.h (from libthecore) : #ifndef __INC_LIBTHECORE_TYPEDEF_H__ #define __INC_LIBTHECORE_TYPEDEF_H__ typedef unsigned long int QWORD; typedef unsigned char UBYTE; typedef signed char sbyte; typedef unsigned short sh_int; typedef unsigned short QWORDZZZ; // A custom type I created typedef unsigned short WORD; #ifndef __WIN32__ #ifndef __cplusplus typedef unsigned char bool; #endif typedef unsigned int DWORD; typedef int BOOL; typedef unsigned char BYTE; typedef unsigned short WORD; typedef long LONG; typedef unsigned long ULONG; typedef int INT; typedef unsigned int UINT; typedef int socket_t; So I created a new type called QWORDZZZ (unsigned short) in typedef.h The main() from game can access it and recognizes it as a proper type (unsigned short) But if I try to define WORD such as above (as an unsigned short) it gets override by WORD(<error-type>) I make 2 conclusions : - During game compilation, it reaches the typedef.h from libthecore which contains the definition of WORD (my source of errors in the compilation) - WORD gets override by something else in the process / is not considered declared Any ideas?
  3. Thanks for your fast reply. Here are my dependencies and build orders for both projects, nothing seems wrong to me (I removed libserverkey on purpose for Avenor2 sources as they were not included and i c/p from VS2022 project but they don't really belong there) [Hidden Content]
  4. 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 !
  5. Hello I have been trying to recompile server sources for Avenor2 files. I have pretty much been able to compile libgame, liblua, libpoly, libsql, libthecore, db but game won't compile and give me over 5000 errors. After some investigating, most of them are due to WORD type that is not recognised properly. I am using VS 2019 and I have compared sources from this setup : Has someone managed to compile those server files in particular ? Here is an example of error : [Hidden Content] Am I missing a library ? A bit clueless at this point to be honest ... Thanks!
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.