DK22Pac / plugin-sdk

An SDK for developing ASI/CLEO plugins for GTA San Andreas, GTA Vice City and GTA III
zlib License
431 stars 114 forks source link

Error while compiling script (C3861 'M_PI': identifier not found) [Visual Studio 2019] #153

Closed kozooh closed 1 year ago

kozooh commented 1 year ago

I tried to compile script for Vice City with Visual Studio 2019 but always got these two errors.

Error C3861 'M_PI': identifier not found CustomColorsVC D:\Pobrane\plugin-sdk-master\shared\Other.h 70 Error C3861 'M_PI': identifier not found CustomColorsVC D:\Pobrane\plugin-sdk-master\shared\Other.h 75

Here's the script which is actually based on this DK22Pacs post

#include "plugin.h"

using namespace plugin;

class CustomColorsVC {
public:
    CustomColorsVC() { 
        patch::SetUChar(0x5582AF, 0);  // Money color : Red
        patch::SetUInt(0x5582AA, 122); // Money color : Green
        patch::SetUInt(0x5582A5, 204); // Money color : Blue
    }
} CustomColorsVC;

I know that is just a constant PI value. But in the header file so I don't know what to do with it. I just blindly add include etc. libraries but without results.

Yes, I've installed plugin-sdk with instruction.

cengizhanbucak commented 1 year ago

most likely I have the same problem related to windows 11 dirext

nekjutsu commented 1 year ago

Add _USE_MATH_DEFINES to preprocessor definitions

kozooh commented 1 year ago

Add _USE_MATH_DEFINES to preprocessor definitions

Thanks