Can't compile with libcurl

I'm trying to compile application using g++ with curl headers. When I try to compile I get errors with undefined references:

test.cpp:(.text+0xc): undefined reference to `curl_easy_init'
test.cpp:(.text+0x1c): undefined reference to `curl_easy_cleanup'

I tried to compile with /usr/lib/libcurl.so argument instead of -lcurl but I got the same error.