我正在尝试将c文件(cvode.c
)链接到一组.dll文件。我在cmd中运行以下两行:
>>> gcc -c -I C:\sundials\inst2\include cvode.c
>>> gcc -shared -o cvode_lib.dll cvode.o -L. C:\sundials\inst2\lib\sundials_cvode.dll -L. C:\sundials\inst2\lib\sundials_nvecserial.dll
第一个命令不会给出任何错误,但第二个命令会给出以下错误消息:
C:\sundials\inst2\lib\sundials_cvode.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
如果我尝试使用ipython导入dll文件,它可以完美运行,并且相同的两行(具有相同的源文件)在运行相同操作系统(Windows 10 64位)的第二台计算机上运行完全相同的版本gcc(安装了最新的Mingw64安装程序)。我也尝试安装cygwin64并使用其gcc版本进行编译,但没有成功。该文件也可以在Ubuntu计算机上完美编译。
我还尝试链接到相应的<sundials>
。lib-files,但这也无效。