Terecle: Tech Careers, Help & How-To GuidesTerecle: Tech Careers, Help & How-To GuidesTerecle: Tech Careers, Help & How-To Guides
  • PCs & Hardware
    • Laptops
  • Software & Services
    • Communications
    • Productivity
  • PC Games
  • Social Media
    • Facebook
    • Messenger
    • Instagram
    • LinkedIn
    • OnlyFans
    • Snapchat
    • Discord
    • TikTok
    • WhatsApp
Terecle: Tech Careers, Help & How-To GuidesTerecle: Tech Careers, Help & How-To Guides
Search
  • PCs & Hardware
    • Laptops
  • Software & Services
    • Communications
    • Productivity
  • PC Games
  • Social Media
    • Facebook
    • Messenger
    • Instagram
    • LinkedIn
    • OnlyFans
    • Snapchat
    • Discord
    • TikTok
    • WhatsApp
Follow US
Operating Systems > How to Fix Fatal Error: Curl/Curl.h: No Such File or Directory
Operating Systems

How to Fix Fatal Error: Curl/Curl.h: No Such File or Directory

Ogechukwu Anthony
Last updated: September 15, 2023 12:18 pm
Ogechukwu Anthony
3 Min Read
Share
fatal error: curl/curl.h: no such file or directory

Linux is not just an operating system that only users comfortable with command-line interfaces could use. Now Modern Linux distros are easy to use, even for beginners, and enables users to debug errors easier. 

We will be looking at the “fatal error: curl/curl.h: no such file or directory” issue,  causes and how to fix the problem.

What causes the fatal error: curl/curl.h: no such file or directory error?

This  error is mainly caused by a Curl installation that is missing or a dependency that makes  your script terminate as soon as you import any related libraries. To resolve this, you need to figure out which variant of Curl you need to install according to your specific case. 

How do I fix the “fatal error: curl/curl.h: no such file or directory”

To solve the “ fatal error: curl/curl.h: no such file or directory” you must install the required Curl version or corresponding dependencies to resolve the error. 

Installing Curl itself is easy, you can do it by following these steps:

Open up a terminal and type in the following command:

sudo apt update

Wait for the command to run,then  install Curl using the following command.

sudo apt install curl

Wait and allow the command to execute successfully. When it is done you should have curl installed on your Linux machine successfully. 

 Verify the installation by typing curl in the terminal monitor the output which should look like this

curl: try 'curl --help' or 'curl --manual' 

If this does not solve the issue. Then know that you are missing some dependencies required by your project. One of them being  the commonly overlooked dependencies libcurl.

install it using either of these commands below

sudo apt-get install libcurl4-gnutls-dev

Alternatively;

sudo apt-get install libcurl4-nss-dev

Alternatively;

sudo apt-get install libcurl4-openssl-dev

These commands will help you install the GNUtls, NSS and OpenSSL variants of libcurl. Depending on what your project requires, installing one or more of these variants to your system will fix the problem.

And when packaging for a specific operating system or use case, you  have to add several specific requirements as well.

Another solution is to add the necessary headers to the program you are using.

If you are developing some native C application using the curl  API ( https://curl.haxx.se/libcurl/c/ ) , then  include the necessary header at the top of the C program as:

<curl/curl.h>

If the error persists, use the  command as a solution to install missing development headers dependency.

$ sudo apt-get install libcurl4-nss-dev

Voila! We have a solution for the “fatal error: curl/curl.h: no such file or directory” error. Try out these few fixes and see if it fixes the problem.

Was this article helpful?
YesNo
Share This Article
Facebook Flipboard Pinterest Reddit Email Copy Link
ByOgechukwu Anthony
I am an experienced tech and innovation writer. It's been 3 years since I started writing at Terecle, covering mostly Consumer electronics and Productivity. In my spare time, I enjoy reading and learning the latest happenings around the tech ecosystem.

You Might Also Like

iOS

How To Get Rid Of Spam Messages On iMessages

By
Dara Eduok
Android Microphone Not Working During Call
Android

How to Fix Android Microphone Not Working During Calls

By
Ogechukwu Anthony
iOS

How to Switch iOS 5 Safari Address Bar

By
Dara Eduok
How Long Does An iPhone Update Take
iOS

How Long Does an iPhone Update Take?

By
Ogechukwu Anthony

Terecle is your #1 authority hub for tech career clarity and growth, guiding you from choosing your path to landing your dream job.

  • Editorial Statement
  • Privacy Policy
  • Cookie Disclosure
  • Advertise with us
  • Contact us

© 2021-2025 HAUYNE LLC., ALL RIGHTS RESERVED​

Terecle is part of Hauyne publishing family. The display of third-party trademarks and trade names on this site does not necessarily indicate any affiliation or endorsement of Terecle.