akk*_*kki 1 c++ linker fortran gfortran c++14
我正在尝试在 INSEL 中创建一个用户定义的块,它需要 C++ 进行编程,并使用 gfortran 链接它。
我的程序中有以下代码
// Setting seed for random number generators
unsigned seed = static_cast<int> (std::chrono::system_clock::now().time_since_epoch().count());
Run Code Online (Sandbox Code Playgroud)
设置为我的随机数生成器的种子。当我使用 g++ (gcc v.5.1.0) 编译它时,它没有显示错误或警告。我的编译命令是
g++ -O0 -Wall -c -g3 -std=c++14 -fmessage-length=0 $(sourcesC)
Run Code Online (Sandbox Code Playgroud)
sourcecC 有我所有的 .cpp 程序。但是当我尝试使用 gfortran 将其链接到:
gfortran -shared -o C:\***\inselUB.dll -Wall -L./ -linselTools $(objects)
Run Code Online (Sandbox Code Playgroud)
我收到错误:
C:***\resources/../src/constants.h:54: 对 `std::chrono::_V2::system_clock::now()' 的未定义引用
collect2.exe:错误:ld 返回 1 退出状态 makefile:11:目标“inselUB”的配方失败
make: *** [inselUB] 错误 1
我只是这种类型接口的初学者。可能是一个简单的错误。有人能给我建议一个解决方案吗?
操作系统:Win 7
| 归档时间: |
|
| 查看次数: |
9352 次 |
| 最近记录: |