Author Topic: libcurl on Arch Linux  (Read 5176 times)

Offline ImDevinC

  • Single posting newcomer
  • *
  • Posts: 2
libcurl on Arch Linux
« on: January 15, 2016, 08:17:16 am »
Good evening! I've been trying to troubleshoot this for a few hours and can't seem to figure it out. So here's what I have so far:
  • curl is installed, which puts libcurl.so in /usr/lib/ and curl.h (and the other headers) in /usr/include/curl
  • I added /usr/include to Search Directories -> Compiler in the global compiler settings
  • I added /usr/lib to Search Directories -> Linker in the global compiler settings
  • I added /usr/include/curl to Search Directories -> Compiler in the project compiler settings
  • I added /usr/lib/libcurl.so to Linker Settings -> Link Libraries in the project compiler settings
  • I included <curl/curl.h>
  • On Curl *curl; I get the error error: 'Curl' was not declared in this scope
Any insight as to what I'm doing wrong? Thanks in advance!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: libcurl on Arch Linux
« Reply #1 on: January 15, 2016, 01:29:12 pm »
1) read this and post a full rebuild log: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
2) probably you write "curl" not "Curl", but we need the full build log to help you

Offline ImDevinC

  • Single posting newcomer
  • *
  • Posts: 2
Re: libcurl on Arch Linux
« Reply #2 on: January 15, 2016, 02:52:11 pm »
Thanks! Here's the build log

Code
-------------- Build: Debug in TestProject (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -I/usr/include/curl -I/usr/include -c /home/user/CppProjects/TestProject/main.cpp -o obj/Debug/main.o
/home/user/CppProjects/TestProject/main.cpp: In function ‘int main()’:
/home/user/CppProjects/TestProject/main.cpp:7:5: error: ‘Curl’ was not declared in this scope
     Curl *curl;
     ^
/home/user/CppProjects/TestProject/main.cpp:7:11: error: ‘curl’ was not declared in this scope
     Curl *curl;
           ^
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: libcurl on Arch Linux
« Reply #3 on: January 15, 2016, 03:18:20 pm »
1) Keep in mind that c is case sensitive...
2) Read the documentation and tutorials for example: http://curl.haxx.se/libcurl/c/ftpget.html for a curl example
3) Look how you have written Curl, and how the struct CURL is really written

greetings