저는 현재 우분투 코드 :: 블록에 있으며 선형 대수를 할 때 몇 가지 문제가 있습니다. 컴파일러 설정에서SOVED : Armadillo Dot 제품 C++
은> 검색 디렉토리> 컴파일러 난,
및 컴파일러 설정에서
이> 검색 디렉토리> 링커 내가 "/ 사용자/lib에"내 liblapack-dev에있는 "는/usr/포함"이 libblas-dev, libboost-dev, libarmadillo-dev는 apt-get를 통해 설치됩니다.
나는 코드의 어느 부분에서 오류가 있는지 언급 했어요. 코드의 어려운 부분이 없으면 내 코드가 제대로 실행되기 때문에 armadillo를 잘 설치했다고 생각합니까? 그렇다면 왜 모든 기능에 액세스 할 수 없습니까?
#include <iostream>
#include <armadillo>
using namespace arma;
using namespace std;
int main()
{
mat A;
A<<1<<2<<endr<<3<<4;
cout<<A;
vec e=A.col(0);
vec r=A.col(1);
cout<<endl<<e<<endl<<r<<endl;//works perfectly up to here
//if only there was not more of these codes
cout<<e*r<<endl;//doesnt work from here anymore
float y=dot(A,A);//from here on i get the error message:
cout<<y<<endl;//'wrapper_ddot_' is not defined
double z=as_scalar(e*r);//and wrapper_blas.hpp file opens
double t=dot(e,r);
cout<<z<<endl;//and points me to line 185
return 0;//with an error
}
ive 그냥 솔루션을 시도했지만 여전히 나에게 같은 오류를주는 작품을 didnt : /. 심지어 다른 모든 것을 주석 처리 할 때도 마찬가지입니다. 사람들이이 기능을 조 변경없이 사용하더라도 몇 가지 자습서에서 본 ive. 덕분에 – maxsieg
실제로 링커에게 어떤 명령을 내 보냅니 까? 난 그냥 다른 사람이 "g ++ -O2 -o armadillo_example armadillo_example.cpp -larmadillo"를 링커에 사용하는 것을 보았습니다.하지만 디렉토리를 변경하면 프로젝트 파일이 프로젝트 파일로 바뀌므로 ur 프로젝트를 통해 매번 링크됩니다. – maxsieg
code :: blocks을 사용하면 '링커 설정 -> 다른 링커 옵션'아래에 '-larmadillo'만 추가하면됩니다. 언급 한 명령 행 예제도 작동해야합니다. –