Home » Miscellaneous

Solution for “undefined reference to `_imp__curl_easy_setopt'”

12 August 2014 No Comment


I was cross compiling a program that required libcurl, so i had to cross compile curl first then compile the other program and pointing it towards that libcurl.

“./configure” was normal, but it failed “make” there was an error while linking

Here is a snippet from config.log

configure:5856: checking whether libcurl is usable
configure:5890: i686-w64-mingw32-gcc -std=gnu99 -o file.exe -g -O2 file.c -L/usr/lib/x86_64-linux-gnu -lcurl >&5
/tmp/ccPPDrjc.o: In function `main’:
/root/program/file.c:17: undefined reference to `_imp__curl_easy_setopt’
collect2: error: ld returned 1 exit status

The solution is simple adding mingw bin directory to the $PATH of operating system.
In linux it’s:

export PATH=/usr/i686-w64-mingw32/bin:$PATH

Your opinion matters!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.