Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

When I run exe on windows xp system, it's throwing following exception:

the procedure entry point gettickcount64 could not be located kernel32.dll

My code:

#include <curl/curl.h>
int main()
    CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_URL, "xxxxxx");
    struct curl_slist *headers = NULL;
    headers = curl_slist_append(headers, "Content-Type: application/json");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\n\t\"UserName\":\"abc\", \n\t\"Password\":\"xyz\"\n}");
    CURLcode ret = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
    return 0;

So, how to solve that error? Please help. Thanks in advance.

From [MS.Learn]: GetTickCount64 function (Requirements section):

Minimum supported client               Windows Vista [desktop apps | UWP apps]

Alternatives:

  • Don't run it on XP (MS no longer supports it), switch to Vista (or newer) that has the function in Kernel32.dll (this is the most obvious one)

  • If you're using a downloaded cURL (prebuilt) library:

  • Rebuild it using the same tools as your app, and either:

  • #define _WIN32_WINNT 0x0501

  • Pass /D_WIN32_WINNT=0x0501 to the compiler

  • If you're including the cURL sources directly, specify the above compiler flag into your VStudio project ([MS.Learn]: /D (Preprocessor Definitions))

  • While browsing the official download page ([curl]: Releases and Downloads), I found [WinampPlugins]: curl 7.53.1 for Windows.
    So, apparently it's possible to download a binary that is XP compatible. It's an older version, and 032 bit only (064 bit XPs are rare anyway), but it can get you going

    I'm trying to run a game on XP and i get the same error as this post's title. After some search, I realized that there's a file named libcurl.dll in the game's folder, which calls this function. I tried to download this XP compatible binary, but I don't know what to do then. Could you help me? – Kobayashi Aug 16, 2019 at 4:45 @Kobayashi: You need to overwrite (back it up first) the libcurl.dll from your project that calls this function with the one you downloaded. – CristiFati Aug 16, 2019 at 7:16

    I guess you have used pre-built version of libcurl from downloads section of site. I never had this problem myself, but since GetTickCount64 is Windows Vista+ API, it means that they have not compiled library with Windows XP compatibility.

    Try to build library yourself and then see if you program runs with any problem or not.

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

  •