Hi,
I have a function implemented in a cpp file and declared in header file. In the main program cpp file I include the header file and use the function. However this fails to link (undefined reference to myFunc). What do I have to change to get it working?
EDIT: pro file:
SOURCES += as241.c \
main.cpp \
normalvar.cpp \
normaldistribution.cpp \
studenttdistribution.cpp
LIBS += -lgsl \
-lgslcblas \
-lm
HEADERS += as241.h \
var.h \
distribution.h \
normalvar.h \
normaldistribution.h \
studenttdistribution.h
In main.cpp I use a function from as241
as241.h:
#ifndef AS241_H
#define AS241_H
double ppnd16(double p);
#endif // AS241_H
as241.cpp:
#include "as241.h"
#include <math.h>
double ppnd16(double p)
{
//code
}