Originally Posted by
jimblumberg
Also posted
here.
Please post your code, it's more likely that the problem is within your code than it is within the system headers.
Jim
I'm sorry. Shouldn't I have posted this here to? If that's the case I can remove this post. No intention on breaking the site rules or trolling.
Well, were could I post the code?
Since it's about a thousand lines of QML and a couple of hundred lines C++. Or should I just post it here?
EDIT. Here's my c++ class. Which is used to call some functions from a library called freesteam, which in terms links to the GNU Scientific Library I believe. Maybe the problem is happening some other place than the code I've written. And I should've added that it builds just fine when building for the desktop. This error only occurs when trying to build for android.
Code:
#ifndef MYSTEAMCLASS_H
#define MYSTEAMCLASS_H
extern "C" {
#include <freesteam/steam_ps.h>
#include <freesteam/steam_pT.h>
#include <freesteam/region4.h>
#include <freesteam/steam_ph.h>
#include <freesteam/steam_pv.h>
#include <freesteam/steam_Ts.h>
#include <freesteam/steam_Tx.h>
#include <stdio.h>
}
#include <QObject>
#include <QDebug>
class MySteamClass : public QObject
{
Q_OBJECT
public:
explicit MySteamClass(QObject *parent = 0);
private:
double pressure=0;
double temperature=0;
double specificEntropy=0;
double specificEnthalpy=0;
double specificInternalEnergy=0;
double specificVolume=0;
double density=0;
double heatCapacity_Cp=0;
double heatCapacity_Cv=0;
double quality=0;
double thermalConductivity=0;
double viscosity=0;
SteamState state;
public:
Q_INVOKABLE void setState_PressureTemperature(double pres, double temp);
Q_INVOKABLE void setState_PressureSpecificInternalEnergy(double pres, double intEn);
Q_INVOKABLE void setState_PressureSpecificEntropy(double pres, double entrop);
Q_INVOKABLE void setState_PressureSpecificEnthalpy(double pres, double enthalp);
Q_INVOKABLE void setState_PressureSpecificVolume(double pres, double enthalp);
Q_INVOKABLE void setState_TemperatureSpecificEntropy(double temp, double entrop);
Q_INVOKABLE double getSpecificEnthalpy();
Q_INVOKABLE double getSpecificEntropy();
Q_INVOKABLE double getInternalEnergy();
Q_INVOKABLE double getSpecificVolume();
Q_INVOKABLE double getDensity();
Q_INVOKABLE double getHeatCapacity_Cp();
Q_INVOKABLE double getHeatCapacity_Cv();
Q_INVOKABLE double getQuality();
Q_INVOKABLE double getThermalConductivity();
Q_INVOKABLE double getViscosity();
Q_INVOKABLE double getTemperature();
Q_INVOKABLE double getPressure();
// freesteam_se
signals:
public slots:
};
#endif // MYSTEAMCLASS_H
Code:
#include "mysteamclass.h"
MySteamClass::MySteamClass(QObject *parent) : QObject(parent)
{
}
void MySteamClass::setState_PressureTemperature(double pres, double temp){
pressure = pres ; temperature = temp;
state = freesteam_set_pT(pres, temp);
specificEnthalpy = freesteam_h(state); //set the properties
specificInternalEnergy = freesteam_u(state);
specificVolume = freesteam_v(state);
specificEntropy = freesteam_s(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
void MySteamClass::setState_PressureSpecificInternalEnergy(double pres, double intEn){
pressure = pres; specificInternalEnergy = intEn;
state =freesteam_set_ps(pres,intEn);
specificEnthalpy = freesteam_h(state); //set the properties
temperature = freesteam_T(state);
specificEntropy = freesteam_s(state);
specificVolume = freesteam_v(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
void MySteamClass::setState_PressureSpecificEntropy(double pres, double entrop){
pressure = pres; specificEntropy = entrop;
state = freesteam_set_ps(pressure, specificEntropy);
specificInternalEnergy = freesteam_u(state);
specificEnthalpy = freesteam_h(state);
temperature = freesteam_T(state);
temperature = freesteam_T(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
void MySteamClass::setState_PressureSpecificEnthalpy(double pres, double enthalp){
pressure = pres; specificEnthalpy = enthalp;
state = freesteam_set_ph(pressure, specificEnthalpy);
temperature = freesteam_T(state);
specificInternalEnergy = freesteam_u(state);
specificVolume = freesteam_v(state);
specificEntropy = freesteam_s(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
void MySteamClass::setState_PressureSpecificVolume(double pres, double vol){
pressure = pres; specificVolume = vol;
state = freesteam_set_pv(pressure,specificVolume);
specificEnthalpy = freesteam_h(state); //set the properties
specificInternalEnergy = freesteam_u(state);
specificVolume = freesteam_v(state);
specificEntropy = freesteam_s(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
void MySteamClass::setState_TemperatureSpecificEntropy(double temp, double entrop){
temperature = temp; specificEntropy = entrop;
state = freesteam_set_Ts(temperature, specificEntropy);
pressure = freesteam_p(state);
specificEnthalpy = freesteam_h(state); //set the properties
specificInternalEnergy = freesteam_u(state);
specificVolume = freesteam_v(state);
density= freesteam_rho(state);
heatCapacity_Cp=freesteam_cp(state);
heatCapacity_Cv= freesteam_cv(state);
quality= freesteam_x(state);
thermalConductivity= freesteam_k(state);
viscosity= freesteam_mu(state);
}
//-----------GETTERS----------\\
double MySteamClass::getSpecificEnthalpy(){
return specificEnthalpy;
}
double MySteamClass::getSpecificEntropy(){
return specificEntropy;
}
double MySteamClass::getInternalEnergy(){
return specificInternalEnergy;
}
double MySteamClass::getSpecificVolume(){
return specificVolume;
}
double MySteamClass::getHeatCapacity_Cp(){
return heatCapacity_Cp;
}
double MySteamClass::getHeatCapacity_Cv(){
return heatCapacity_Cv;
}
double MySteamClass::getQuality(){
return quality;
}
double MySteamClass::getThermalConductivity(){
return thermalConductivity;
}
double MySteamClass::getViscosity(){
return viscosity;
}
double MySteamClass::getDensity(){
return density;
}
double MySteamClass::getTemperature(){
return temperature;
}
double MySteamClass::getPressure(){
return pressure;
}
And main.cpp.
Code:
extern "C" {
#include <freesteam/steam_ps.h>
#include <freesteam/steam_pT.h>
#include <freesteam/region4.h>
#include <stdio.h>
}
#include <iostream>
#include <fstream>
using namespace std;
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "mysteamclass.h"
int main(int argc, char *argv[])
{
qmlRegisterType<MySteamClass>("MySteamClass",1,0,"MySteamClass");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
Thank you for the answer.