함수를 cpp 파일에 구현하고 헤더 파일에 선언했습니다. 주 프로그램 cpp 파일에서 헤더 파일을 포함하고 함수를 사용합니다. 그러나 이것은 링크하지 못합니다 (정의되지 않은 myFunc 참조). 작동 시키려면 무엇을 변경해야합니까?QtCreator를 여러 개의 cpp 및 헤더 파일로 컴파일하려면 어떻게합니까?
편집 : 프로 파일 :
이 MAIN.CPP에서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
내가 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
}
* .pro 파일의 내용은 무엇입니까? – elcuco
5K 담당자와 질문을하는 법을 알지 못한다면 조금 슬플 것입니다. –
쉘에서 make의 출력을 게시 할 수 있습니까? BTW, IMHO 더 이상 stackoverflow 질문입니다. http://qtcentre.org에서 다시 묻는 것은 어떨까요? – elcuco