如何在我的项目中使用FFTW DLL导入库.lib作为静态.lib? [英] How to use FFTW DLL import library .lib as a static .lib in my project?

查看:81
本文介绍了如何在我的项目中使用FFTW DLL导入库.lib作为静态.lib?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解C ++和编译小型插件(始终基于相似且布局合理的工作流程).尽管目前我需要将FFTW的最新版本编译到一个静态库中(或从编译的版本中获取它,这应该会容易得多),但这给了我极大的困难.可能是因为我不知道编译的来龙去脉.请注意,我正在使用Visual Studio在Windows上工作.

I've knowledge of C++ and compiling small plug-ins (always based on a similar and laid out workflow). Though currently I need to compile the latest version of FFTW into a static library (or get it from the compiled version which should supposedly be a lot easier) and it's giving me an insanely hard time. Probably because I don't know the ins and outs of compiling. As a note I'm working on Windows with Visual Studio.

因为我真的很想知道这应该如何工作,所以我在这里问这个问题.

Since I really want to know how this should work I'm asking the question here.

基本上,我需要Windows上可以包含在另一个Visual Studio项目中的fftw3f库的静态.lib.

Basically I need a static .lib of fftw3f library on Windows that I can include in another Visual Studio project.

我做的第一件事是从网站上下载FFTW的64位dll(希望我可以使用它). http://www.fftw.org/install/windows.html

The first I did was download the 64 bit dll's of FFTW from the website (hoping I could use this). http://www.fftw.org/install/windows.html

然后,我完成了他们所说的相应步骤,即:在lib.exe中运行以下命令.

Then I've done the accompanying step they stated, that is: Run the following in lib.exe.

 lib /def:libfftw3-3.def
 lib /def:libfftw3f-3.def
 lib /def:libfftw3l-3.def

我也已经完成了此操作,并获得了一个.lib文件,可以在我的项目中正确使用它.我已经能够编译我的项目,但是输出构建显然是动态链接到该库的,而不是将其包含为静态库.

I've done this as well and got a .lib file that I could use in my project correctly. I've been able to compile my project, yet the output build apparently dynamically linked to the library instead of including it as a static library.

我正在将项目编译为.dll,但要求fftw3f库静态包含在我的输出中.

I'm compiling my project to .dll but require the fftw3f library to be statically included in my output.

使用 lib.exe/list libfftw3f-3.lib ,我能够发现lib文件引用了libfftw3f-3.dll.

Using lib.exe /list libfftw3f-3.lib I was able to find out that the lib file was referencing the libfftw3f-3.dll.

根据我的Google搜索结果,这意味着我创建的.lib文件是 DLL导入库,而不是静态库.

According to my google results this would mean the .lib file that I created is a DLL import library instead of static library.

很难弄清楚该如何表达我的问题,因为我不确定该术语是什么以及幕后发生了什么.我猜:

It's hard to figure out how to phrase my question because I'm not sure what the terminology is and what's going on behind the scenes. I guess:

  • 如何在我自己的项目中将从lib.exe创建的libfftw3f-3.lib文件用作静态库.这样它就包含在我的输出.dll中,而不是动态链接了?

根据我从评论/答案中学到的知识,我很乐意更新/编辑/重新表达我的问题,以使其他大多数用户更理解,因为我可能会使用术语

推荐答案

您不能期望将DLL转换为静态库.

You cannot expect to convert a DLL into a static library.

为了创建静态库,您需要从其源代码重新编译该库,并使用静态库的输出目标.如果您无法获得源代码,那么您的目标就无法实现.

In order to create a static library you need to re-compile the library from its source code, with an output target that is a static library. If you cannot obtain the source code, then your goal cannot be achieved.

这篇关于如何在我的项目中使用FFTW DLL导入库.lib作为静态.lib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆