Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 396
Art Em Avatar asked Oct 16 '25 12:10

Art Em


1 Answers

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.

like image 72
Art Em Avatar answered Oct 18 '25 08:10

Art Em



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!