Hi friends,
I'm currently trying to use an external c/c++ api in Qt Creator. Its an NASA api to calculate Spacecraft and planetary trajectories. http://naif.jpl.nasa.gov/naif/toolkit.html
I just created a new widget project and edited the project file ,this is what is looks like.
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qt_spice
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp\
$$PWD/cspice/src/cspice/*
HEADERS += mainwindow.h\
$$PWD/cspice/include/*
INCLUDEPATH += $$PWD/cspice/include/
LIBS += -lm
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qt_spice
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp\
$$PWD/cspice/src/cspice/*
HEADERS += mainwindow.h\
$$PWD/cspice/include/*
INCLUDEPATH += $$PWD/cspice/include/
LIBS += -lm
To copy to clipboard, switch view to plain text mode
This is what my project tree looks like:
project tree.png
I included the api in my main.cpp and the indexing recognizes it.
#include "mainwindow.h"
#include <QApplication>
#include "SpiceUsr.h"
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include <QApplication>
#include "SpiceUsr.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
I have used this api on this machine in the eclipse ide so the compilers are working fine.
When i try to compile i hit this problem (Compile Output):
16:32:32: Running steps for project qt_spice...
16:32:32: Configuration unchanged, skipping qmake step.
16:32:32: Starting: "/usr/bin/make"
/home/gordon/Qt/5.5/gcc_64/bin/qmake -spec linux-g++ CONFIG+=debug -o Makefile ../qt_spice/qt_spice.pro
gcc -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../qt_spice -I. -I../qt_spice/cspice/include -I../../5.5/gcc_64/include -I../../5.5/gcc_64/include/QtWidgets -I../../5.5/gcc_64/include/QtGui -I../../5.5/gcc_64/include/QtCore -I. -I../../5.5/gcc_64/mkspecs/linux-g++ -o mkprodct.o ../qt_spice/cspice/src/cspice/mkprodct.csh
gcc: warning: ../qt_spice/cspice/src/cspice/mkprodct.csh: linker input file unused because linking not done
gcc -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../qt_spice -I. -I../qt_spice/cspice/include -I../../5.5/gcc_64/include -I../../5.5/gcc_64/include/QtWidgets -I../../5.5/gcc_64/include/QtGui -I../../5.5/gcc_64/include/QtCore -I. -I../../5.5/gcc_64/mkspecs/linux-g++ -o rawio.o ../qt_spice/cspice/src/cspice/rawio.h
../qt_spice/cspice/src/cspice/rawio.h:20:27: error: unknown type name 'size_t'
extern int read(int,void*,size_t), write(int,void*,size_t);
^
../qt_spice/cspice/src/cspice/rawio.h:24:1: error: unknown type name 'FILE'
extern FILE *fdopen(int, const char*);
^
make: *** [rawio.o] Error 1
16:32:39: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qt_spice (kit: Desktop Qt 5.5.1 GCC 64bit)
When executing step "Make"
16:32:39: Elapsed time: 00:07.
16:32:32: Running steps for project qt_spice...
16:32:32: Configuration unchanged, skipping qmake step.
16:32:32: Starting: "/usr/bin/make"
/home/gordon/Qt/5.5/gcc_64/bin/qmake -spec linux-g++ CONFIG+=debug -o Makefile ../qt_spice/qt_spice.pro
gcc -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../qt_spice -I. -I../qt_spice/cspice/include -I../../5.5/gcc_64/include -I../../5.5/gcc_64/include/QtWidgets -I../../5.5/gcc_64/include/QtGui -I../../5.5/gcc_64/include/QtCore -I. -I../../5.5/gcc_64/mkspecs/linux-g++ -o mkprodct.o ../qt_spice/cspice/src/cspice/mkprodct.csh
gcc: warning: ../qt_spice/cspice/src/cspice/mkprodct.csh: linker input file unused because linking not done
gcc -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../qt_spice -I. -I../qt_spice/cspice/include -I../../5.5/gcc_64/include -I../../5.5/gcc_64/include/QtWidgets -I../../5.5/gcc_64/include/QtGui -I../../5.5/gcc_64/include/QtCore -I. -I../../5.5/gcc_64/mkspecs/linux-g++ -o rawio.o ../qt_spice/cspice/src/cspice/rawio.h
../qt_spice/cspice/src/cspice/rawio.h:20:27: error: unknown type name 'size_t'
extern int read(int,void*,size_t), write(int,void*,size_t);
^
../qt_spice/cspice/src/cspice/rawio.h:24:1: error: unknown type name 'FILE'
extern FILE *fdopen(int, const char*);
^
make: *** [rawio.o] Error 1
16:32:39: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qt_spice (kit: Desktop Qt 5.5.1 GCC 64bit)
When executing step "Make"
16:32:39: Elapsed time: 00:07.
To copy to clipboard, switch view to plain text mode
am i making a newbie mistake? have i missed something? Can anyone point me in the right direction? If more information is needed im glad to provide it I've been messing around with this problem for the last 3 days and im lightly frustrated thx in advance!
Bookmarks