I am trying to use the cURL library(I am pretty new to libraries so I apologize for my ignorance). I use the command:
g++ -I"C:/Curl/include" distance.cpp -o run -L"C:\Program Files\Curl\lib" -lcurl
to compile my code.
I then try to run the .exe file called run. The execution fails and the error message says."The code execution cannot proceed because libcurl-x64.dll was not found." My initial thought was to change the name of the .dll file to match that of the error. The file that comes in the windows-64 bit version of curl is called libcurl.dll (my system claims that it is a ".A file"). I tried running the .exe file with the renamed "libcurl-x64.dll" file. A different error that says, that libcurl-x64.dll is either not designed to run on windows(which isn't the case because it is the Windows-64 bit version) or contains an error. Unless the source file from the cURL website is erroneous, I can't see how any files contain errors. I would think since curl is a popular library, its files are not meant to be renamed.
The funny thing is that I have 1) added libcurl.dll to my working directory and 2) added a system path called CURL_PATH to my environmental variables. I am not sure how the compiler cannot find this file.
I have followed this Trouble importing dll library into CodeBlocks Linker but my lib file does not have an additional folder inside of it.
There are a lot of variables that I have checked including the architecture of my chip.(I have The windows Surface 7 Snapdragon which uses ARM.) I initially tried the ARM64 version but received a "Files not recognized" error when compiling. I am now using the windows 64bit version of curl due to some other reading I have doing. Like stated before my code compiles to I think I resolved that issue. I also have a minimal reproducible example of my .cpp code and in case that helps.
Any help would be greatly appreciated. I imagine there is something else I have to do in order to link that file. I thought I was doing that when compiling but apparently not. I am using vscode. Please let me know if you have any questions. I appreciate your time!
My .cpp source code for reference:
#include <C:\Program Files\Curl\include\curl\curl.h>
int main() {
/*auto curl =*/ curl_easy_init();
}