2014-02-14 5 views
1

저는 make를 처음 사용하기 때문에 여기에 제공된 Qt 밀도 데모 용 RInside 예제를 실행하려고합니다 : http://dirk.eddelbuettel.com/blog/2011/03/25/. 나는 다음과 같은 파일에 코드를 저장 한 :내부 편집 : 대상 만들기

MAIN.CPP 메이크 qtdensity.cpp 내가 우분투 13.10를 실행하고/qtdensity.h

을 포함, 나는 R, Rcpp 및 내부가 설치되어 있습니다. 내가 터미널로 이동

> make -f Makefile 

를 실행하면 나는

make: *** No targets. Stop. 

날 진행 방법을 알려 주시기 바랍니다 오류를 얻을.

난 그냥 파일을 생성 할 수 있었다 한 :

내가 내 질문을 확장해야합니다 있도록이 첫 번째 대답 후속 물어 볼 수 없습니다


주셔서 감사합니다 MAIN.CPP, qtdensity.cpp, qtdensity.h에 qmake를 실행하고 일을하지만, 어떤 qtdensity.pro를 걸 실행하려고 할 때, 나는 다음과 같은 오류를 얻을 : R의

로트 - 관련 오류 ...

qtdensity.cpp:(.text+0x53a): undefined reference to `Rf_mkString' 
qtdensity.cpp:(.text+0x54e): undefined reference to `Rf_install' 
qtdensity.cpp:(.text+0x559): undefined reference to `Rf_findVarInFrame' 
qtdensity.cpp:(.text+0x560): undefined reference to `R_UnboundValue' 
... 

qtdensity.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal' 
qtdensity.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN' 
main.o: In function `_GLOBAL__sub_I_main': 
main.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal' 
main.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN' 
main.o: In function `main': 
main.cpp:(.text.startup+0x352): undefined reference to `RInside::RInside(int, char const* const*, bool, bool, bool)' 
main.cpp:(.text.startup+0x397): undefined reference to `RInside::~RInside()' 
main.cpp:(.text.startup+0x3b3): undefined reference to `RInside::~RInside()' 
moc_qtdensity.o: In function `_GLOBAL__sub_I__ZN9QtDensity18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv': 
moc_qtdensity.cpp:(.text.startup+0x2a5): undefined reference to `R_NaReal' 
moc_qtdensity.cpp:(.text.startup+0x2b2): undefined reference to `R_NaN' 
collect2: error: ld returned 1 exit status 
make: *** [qdensity] Error 1 
+0

는 R 또는 RInside와 연결하지 않았다. 시스템이 비표준 일 수 있습니다. 내가 너에게 보여준 것처럼 - 여기에서 일한다. –

답변

0

Qt 예제는 Qt를 사용하기 때문에 다릅니다. 항상은 .pro 파일에서 Makefile 자체를 만들어야 시작할 필요가 있습니다. 증인 :

[email protected]:~/git/rinside/inst/examples/qt$ ls -l  ## no Makefile 
total 28 
drwxrwxr-x 2 edd edd 4096 Dec 27 18:38 cmake 
-rw-rw-r-- 1 edd edd 518 Dec 27 18:38 main.cpp 
-rw-rw-r-- 1 edd edd 5953 Dec 27 18:38 qtdensity.cpp 
-rw-rw-r-- 1 edd edd 1532 Dec 27 18:38 qtdensity.h 
-rw-rw-r-- 1 edd edd 2378 Feb 11 20:14 qtdensity.pro 
-rw-rw-r-- 1 edd edd 887 Dec 27 18:38 README 
[email protected]:~/git/rinside/inst/examples/qt$ qmake  ## creates Makefile 
[email protected]:~/git/rinside/inst/examples/qt$ make 
g++ -c -m64 -pipe -I/usr/share/R/include [... lots and lots omitted ...] 
g++ -m64 -Wl,-O1 -o qtdensity qtdensity.o main.o moc_qtdensity.o [....] 
[email protected]:~/git/rinside/inst/examples/qt$ ls -l qtdensity 
-rwxrwxr-x 1 edd edd 76666 Feb 14 15:02 qtdensity 
[email protected]:~/git/rinside/inst/examples/qt$ 

는이 디렉토리에있는 README에 설명 물론입니다 ...