Closed Marjan112 closed 1 year ago
To get rid of these errors you need to define SAMPGDK_AMALGAMATION
macro before including sampgdk.h
or define it globally in your project settings. This will tell the code to not use dllimport for importing GDK functions.
I'm not sure exactly why I did not add that definition to sampgdk.h in the amalgamation build... I will consider doing that in the next version.
When i compile my code i get this errors: C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1318): error C2491: 'sampgdk_GetNatives': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1322): error C2491: 'sampgdk_FindNative': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1329): error C2491: 'sampgdk_CallNative': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1333): error C2491: 'sampgdk_InvokeNative': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1345): error C2491: 'sampgdk_InvokeNativeV': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(1350): error C2491: 'sampgdk_InvokeNativeArray': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2488): error C2491: 'sampgdk_GetVersion': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2492): error C2491: 'sampgdk_GetVersionString': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2582): error C2491: 'sampgdk_Supports': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2586): error C2491: 'sampgdk_Load': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2590): error C2491: 'sampgdk_Unload': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2594): error C2491: 'sampgdk_ProcessTick': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2598): error C2491: 'sampgdk_logprintf': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2605): error C2491: 'sampgdk_vlogprintf': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2928): error C2491: 'sampgdk_CreateActor': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2944): error C2491: 'sampgdk_DestroyActor': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2956): error C2491: 'sampgdk_IsActorStreamedIn': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2969): error C2491: 'sampgdk_SetActorVirtualWorld': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2982): error C2491: 'sampgdk_GetActorVirtualWorld': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(2994): error C2491: 'sampgdk_ApplyActorAnimation': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3020): error C2491: 'sampgdk_ClearActorAnimations': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3032): error C2491: 'sampgdk_SetActorPos': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3047): error C2491: 'sampgdk_GetActorPos': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3074): error C2491: 'sampgdk_SetActorFacingAngle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3087): error C2491: 'sampgdk_GetActorFacingAngle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3104): error C2491: 'sampgdk_SetActorHealth': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3117): error C2491: 'sampgdk_GetActorHealth': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3134): error C2491: 'sampgdk_SetActorInvulnerable': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3147): error C2491: 'sampgdk_IsActorInvulnerable': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3159): error C2491: 'sampgdk_IsValidActor': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3188): error C2491: 'sampgdk_IsValidVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3200): error C2491: 'sampgdk_GetVehicleDistanceFromPoint': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3215): error C2491: 'sampgdk_CreateVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3235): error C2491: 'sampgdk_DestroyVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3247): error C2491: 'sampgdk_IsVehicleStreamedIn': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3260): error C2491: 'sampgdk_GetVehiclePos': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3287): error C2491: 'sampgdk_SetVehiclePos': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3302): error C2491: 'sampgdk_GetVehicleZAngle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3319): error C2491: 'sampgdk_GetVehicleRotationQuat': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3351): error C2491: 'sampgdk_SetVehicleZAngle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3364): error C2491: 'sampgdk_SetVehicleParamsForPlayer': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3379): error C2491: 'sampgdk_ManualVehicleEngineAndLights': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3388): error C2491: 'sampgdk_SetVehicleParamsEx': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3407): error C2491: 'sampgdk_GetVehicleParamsEx': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3454): error C2491: 'sampgdk_GetVehicleParamsSirenState': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3466): error C2491: 'sampgdk_SetVehicleParamsCarDoors': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3482): error C2491: 'sampgdk_GetVehicleParamsCarDoors': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3514): error C2491: 'sampgdk_SetVehicleParamsCarWindows': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3530): error C2491: 'sampgdk_GetVehicleParamsCarWindows': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3562): error C2491: 'sampgdk_SetVehicleToRespawn': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3574): error C2491: 'sampgdk_LinkVehicleToInterior': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3587): error C2491: 'sampgdk_AddVehicleComponent': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3600): error C2491: 'sampgdk_RemoveVehicleComponent': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3613): error C2491: 'sampgdk_ChangeVehicleColor': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3627): error C2491: 'sampgdk_ChangeVehiclePaintjob': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3640): error C2491: 'sampgdk_SetVehicleHealth': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3653): error C2491: 'sampgdk_GetVehicleHealth': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3670): error C2491: 'sampgdk_AttachTrailerToVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3683): error C2491: 'sampgdk_DetachTrailerFromVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3695): error C2491: 'sampgdk_IsTrailerAttachedToVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3707): error C2491: 'sampgdk_GetVehicleTrailer': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3719): error C2491: 'sampgdk_SetVehicleNumberPlate': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3735): error C2491: 'sampgdk_GetVehicleModel': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3747): error C2491: 'sampgdk_GetVehicleComponentInSlot': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3760): error C2491: 'sampgdk_GetVehicleComponentType': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3772): error C2491: 'sampgdk_RepairVehicle': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3784): error C2491: 'sampgdk_GetVehicleVelocity': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3811): error C2491: 'sampgdk_SetVehicleVelocity': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3826): error C2491: 'sampgdk_SetVehicleAngularVelocity': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3841): error C2491: 'sampgdk_GetVehicleDamageStatus': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3873): error C2491: 'sampgdk_UpdateVehicleDamageStatus': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3889): error C2491: 'sampgdk_SetVehicleVirtualWorld': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3902): error C2491: 'sampgdk_GetVehicleVirtualWorld': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3914): error C2491: 'sampgdk_GetVehicleModelInfo': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3959): error C2491: 'sampgdk_SendClientMessage': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3976): error C2491: 'sampgdk_SendClientMessageToAll': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(3992): error C2491: 'sampgdk_SendPlayerMessageToPlayer': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4009): error C2491: 'sampgdk_SendPlayerMessageToAll': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4025): error C2491: 'sampgdk_SendDeathMessage': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4039): error C2491: 'sampgdk_SendDeathMessageToPlayer': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4054): error C2491: 'sampgdk_GameTextForAll': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4071): error C2491: 'sampgdk_GameTextForPlayer': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4089): error C2491: 'sampgdk_GetTickCount': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4098): error C2491: 'sampgdk_GetMaxPlayers': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4107): error C2491: 'sampgdk_VectorSize': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4121): error C2491: 'sampgdk_GetPlayerPoolSize': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4130): error C2491: 'sampgdk_GetVehiclePoolSize': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4139): error C2491: 'sampgdk_GetActorPoolSize': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4148): error C2491: 'sampgdk_SHA256_PassHash': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4173): error C2491: 'sampgdk_SetSVarInt': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4189): error C2491: 'sampgdk_GetSVarInt': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4204): error C2491: 'sampgdk_SetSVarString': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4223): error C2491: 'sampgdk_GetSVarString': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4244): error C2491: 'sampgdk_SetSVarFloat': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4260): error C2491: 'sampgdk_GetSVarFloat': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4275): error C2491: 'sampgdk_DeleteSVar': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4290): error C2491: 'sampgdk_GetSVarsUpperIndex': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4299): error C2491: 'sampgdk_GetSVarNameAtIndex': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4317): error C2491: 'sampgdk_GetSVarType': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4332): error C2491: 'sampgdk_SetGameModeText': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4347): error C2491: 'sampgdk_SetTeamCount': definition of dllimport function not allowed C:\Users\Maki\Desktop\sampgdk\sampgdk/sampgdk.c(4347): fatal error C1003: error count exceeds 100; stopping compilation
So, if someone knows how to fix this please reply