简体   繁体   中英

Symbol lookup error undefined symbol: curl_mime_init

This error happens, when I try to run my program, after compilation, with this code:

curl_mime *form = NULL;
curl_mimepart *field = NULL;
for (int j = 0; j < files.size();) {
    form = curl_mime_init(handle);
    field = curl_mime_addpart(form);
    curl_mime_name(field, files[j].c_str());
    curl_mime_filedata(field, files[j+1].c_str());
    j+=2;
}
curl_easy_setopt(handle, CURLOPT_MIMEPOST, form);

Exit code 127.
if I remove this part of the code, everything works fine. My options for compiler g++-8:
-lcurl -L/usr/local/lib -I/usr/local/include
I ve tried to reinstall curl, but the problem doesn't go away.
Version of libcurl is: libcurl 7.60.0

I don't want to replace it with curl_formadd.

Daniel Stenberg was right, it all was happening because of two versions of libcurl library installed on my computer. it's not enough to use "apt-get remove curl", but it's also necessary to remove libcurl3(4)-gnutils. and only then, you can try to install the new version of libcurl3(4)-gutils.

Try to set the runtime LD_LIBRARY_PATH

$LD_LIBRARY_PATH=/home/user/tools/curl/lib/.libs/ ./multipost

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM