在 Windows 上设置 midiIO 库
我已经下载了 midiIO 库,在自述文件中写道:
- 编辑文件 Makefile.library 并设置 OSTYPE 和 OSSUBTYPE 以匹配您的硬件/操作系统设置。
- 输入“make library”来编译库。它将在 unix 中创建为 lib/libmidiio.a。
- 编辑文件 Makefile.examples 并设置 OSTYPE 和 OSSUBTYPE 以匹配您的硬件/操作系统设置。
另外,如果您使用 ALSA,请取消注释 POSTFLAG 以使用 alsa 库 (-lasound)。- 键入“make Examples”编译示例目录中的示例程序。示例程序将放置在 bin 目录中。
1 + 3 很好,但 2 + 4 超出了我的能力。我以前在 UNIX 环境中工作过,并且使用过带标志的 gcc,但我需要在 Windows 中完成此操作。我通常使用 Visual Studio,但不知道如何实现这一点。我已经下载了 Dev-C++(如果有的话),但我不知道如何处理 makefile?
I've downloaded the midiIO library and in the readme it says:
- edit the file Makefile.library and set the OSTYPE and OSSUBTYPE to match your hardware/os setup.
- type "make library" to compile the library. It will be created as lib/libmidiio.a in unix.
- edit the file Makefile.examples and set the OSTYPE and OSSUBTYPE to match your hardware/os setup.
Also, if you are using ALSA, then uncomment out the POSTFLAG to use the alsa library (-lasound).- type "make examples" to compile the example programs in the examples directory. The example programs will be place in the bin directory.
1 + 3 are fine but 2 + 4 are over my head. I've worked in a unix environment before and have used gcc with flags but I need to get this done in Windows. I typically use Visual Studio but don't know how to achieve this with that.. I've downloaded Dev-C++ if that's any use but I don't know what to do with the makefiles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
忽略 makefile 并在 Visual C++ 中设置一个新项目。将您的目标设置为静态库(在 Win32 中将是 .lib 文件,而不是您可能知道的 unix 中的 .a 文件)。该项目不太可能开箱即用,因此您可能必须处理一些与 UNIX 特定符号相关的编译错误。我快速浏览了一下源代码,它看起来写得相当好,所以我认为直接在 Windows 中构建它应该不会遇到很多问题。
或者,您可以使用 cygwin 中真正的
make
工具构建源代码,但这意味着您需要将 cygwin 库与最终产品一起分发。这可能会带来麻烦,也可能不会带来更多麻烦,特别是如果您已经在项目的其余代码中使用 VC++。Ignore the makefiles and set up a fresh project in Visual C++. Make your target a static library (which will be a .lib file in Win32, not a .a file as in unix as you probably know). It is unlikely that the project will build out of the box, so you might have to deal with some compilation errors relating to unix-specific symbols. I took a quick look at the source code, and it looks fairly well-written, so I don't think you should have many problems building it directly in Windows.
Alternately, you could build the source using the real
make
tool in cygwin, but this means that you would need to distribute the cygwin library with your final product. This may or may not be more trouble than it's worth, especially if you are already using VC++ for the rest of your project's code.