I am trying to link my lib files with my header files, but every time it fails. I have changed tasks.json numerous times, but I cannot get it to work. The header part works, I know that, but I get
”’
C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x47): undefined reference to _imp__curl_easy_init' C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0xdf): undefined reference to
_imp__curl_easy_setopt’
C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0xfc): undefined reference to _imp__curl_easy_setopt' C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x118): undefined reference to
_imp__curl_easy_setopt’
C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x135): undefined reference to _imp__curl_easy_setopt' C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x158): undefined reference to
_imp__curl_easy_setopt’
C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x165): undefined reference to _imp__curl_easy_perform' C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x17b): undefined reference to
_imp__curl_easy_strerror’
C:UsersPCAppDataLocalTempccvMbCZC.o:analysis.cpp:(.text+0x1f3): undefined reference to `_imp__curl_easy_cleanup’
collect2.exe: error: ld returned 1 exit status
”’
every time I try to run or build my code. I am new to c++ and want to use the curl library, but have tried
“command”: “C:MinGWbing++.exe”,
“args”: [
“-I”, “C:UsersPCOneDriveDesktopDecenturminclude”,
“-L”, “C:UsersPCOneDriveDesktopDecenturmlib”,
“-o”, “${workspaceFolder}analysis.exe”,
“${workspaceFolder}analysis.cpp”,
“-lcurl”
and alike many times.
I would be very grateful for any help
I expect the code to run – for the .hpp to find the .a files, and the reference to work.
Doge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.