My code is throwing an error sayiung it can't find wiringPi.h. I thought that setting project > configuration properties > linker > Additional library directories to the place the header is contained would work. However, I still get this error:
Error cannot find wiringPi: No such file or directory Agresso C:\usr\bin\ld 1
#include <iostream>
#include <cmath>
#include <wiringPi.h>
const int thermistorPin = 0; // thermistor is connected to GPIO 0
const int B = 3950; // B value of thermistor
const int R0 = 10000; // R0 = 10kOhm
const int R_LIMIT = 100000; // maximum value for R
double readTemperature()
{
int a = analogRead(thermistorPin);
double R = R_LIMIT * a / (1023 - a);
double T = 1 / (log(R / R0) / B + 1 / 298.15) - 273.15;
return T;
}
int main(void)
{
if (wiringPiSetup() == -1)
return 1;
while (true)
{
double temperature = readTemperature();
std::cout << "Temperature: " << temperature << " C" << std::endl;
delay(1000);
}
return 0;
}
Any thoughts? I am using windows subsystem for Linux.
I tried to link wiringPi.h via project configuration properties.
Program should compile.