Introduction: I haven't fought in a Linux environment for a while. I just need to study the curl API usage. I tried to compile a simple curl example and found many problems, finally, I decided to record the process to avoid making similar simple mistakes in the future. It would be a blessing to help a passer-by!
Ingredients:
- Ubuntu 12.04 64-bit has installed basic GCC, G ++, and make.
- Simple. c is the simplest C instance of curl on the official website.
Procedure:
1. First install the curl Development Environment
Sudo apt-Get install libcurl4-openssl-dev
2. Compile the link.
GCC simple. C-lcurl-o simple
3. Run it.
./Simple
Tips:
The default link directory may be placed in three places:
- /Etc/lD. So. conf
- /Etc/lD. So. conf. d/
- Environment Variable LD_LIBRARY_PATH
If the Linked Library is not in the default path, you can also use the GCC parameter, such as-L/Some/path/lib.