我有来自sigpack网站的以下代码
System.String[]
我将其保存为exFFT1
当我使用g ++ - 6.4.0 with cygwin在cygwin下构建文件时:
#include "sigpack.h"
using namespace arma;
using namespace sp;
int main()
{
int N = 45191; // Large prime number
FFTW ss(N,FFTW_ESTIMATE);
vec x(N);
cx_vec Sxx(N);
vec P(N);
clock_t tic;
for (int n = 1; n < 5; n++)
{
x.randn();
tic = clock();
Sxx = ss.fft(x);
cout << "FFTW Loop[" << n << "]. Time = " << (clock() - tic)/
double(CLOCKS_PER_SEC) << endl;
x.randn();
tic = clock();
Sxx = fft(x);
cout << " FFT Loop[" << n << "]. Time = " << (clock() - tic) /
double(CLOCKS_PER_SEC) << endl;
}
return 0;
}
以下是错误消息:
g++ -Wall -std=gnu++11 -I/home/budiarjo/sigpack-1.2.4/sigpack/ -I/usr/local/include/ -I/opt/OpenBLAS/include/ -L/opt/OpenBLAS/lib/ -L/usr/local/lib/ -DHAVE_FFTW -lblas -llapack -Dunix exFFT1.cpp -lfftw3 -o exFFT1
但是在使用g ++ - 4.8的Raspberry Pi中,当我使用命令
构建文件时/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x1cc): undefined reference to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE'
/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x242): undefined reference to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE'
/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x6db): undefined reference to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE'
/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x752): undefined reference to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE'
/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x1662): undefined reference to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE'
/tmp/ccRsp1Bf.o:exFFT1.cpp:(.text.startup+0x16f9): more undefined references to `__emutls_v._ZN4arma23arma_rng_cxx11_instanceE' follow
collect2: error: ld returned 1 exit status
我可以在没有任何错误消息的情况下成功构建。
我的cygwin设置有什么问题?
我应该用g ++ - 4.80替换cygwin中的g ++ - 6.4.0吗?如何降级它,因为如果我编译并制作g ++ - 4.80包,我会得到错误消息,因为在此过程中使用gcc / g ++ - 6.40。