I'm starting to learn c ++, so the problem can be completely stupid, I even feel it. It consists of the following. I put DevCpp, download libcurl.a, here's the source file, call it "main.c" mode "plain C".
#include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } return 0; }
When compiling from both DevCpp and compile.bat
@echo off mingw32-gcc -I"D:\\_CPP_\\devpaks\\include" -c main.c -o "main.o" -DCURL_STATICLIB mingw32-g++ main.o -o "pr2.exe" -L"D:\\_CPP_\\Dev-Cpp\\lib" -lcurl -lws2_32 -lwinmm pause
(there were both gcc, both g ++ and generally in all variants, c ++ code is also test) gives the following:
D:\\_CPP_\\Dev-Cpp\\lib/libcurl.a(content_encoding.o)(.text+0x5d): undefined reference to 'inflateEnd'
[ ... Π΅ΡΠ΅ 5 Ρ Π΄ΡΡΠ³ΠΈΠΌΠΈ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠΌΠΈ ... ]
collect2: ld returned 1 exit status
ΠΠ»Ρ ΠΏΡΠΎΠ΄ΠΎΠ»ΠΆΠ΅Π½ΠΈΡ Π½Π°ΠΆΠΌΠΈΡΠ΅ Π»ΡΠ±ΡΡ ΠΊΠ»Π°Π²ΠΈΡΡ . . .
Two nights of googling gave this result: linking is there, the PATH environment variable is in order (checked), the library and the headers from the site. Reloaded) There are no gaps in the paths. Hello world compiles fine, but any connected library (poco, boost, clSockets) crashes the program.
Has anyone come across this?
UPD: sorry, winXP SP2