使用mingw在windows上编译libnoise [英] Compiling libnoise on windows with mingw
问题描述
这是我的第一篇文章,如果我做错了,请原谅我。
This is my first post here so forgive me if I've done something wrong.
我一直在努力这个几天,终于决定承诺和寻求帮助。简单地说,我想在Windows上使用mingw编译libnoise(1.0.0)。然而,似乎缺乏在线信息。
I've been struggling with this for a few days and I've finally decided to concede and ask for help. Put simply, I would like to compile libnoise (1.0.0) on windows using mingw. However, there seems to be a lack of information available online.
我已从网站下载源文件,并按照INSTALL文本文件中的说明指示我应该运行命令CXXFLAGS =' - O3 -fomit-框架指针'make(我从mingW shell做)。
I have downloaded the source files from the website and followed the instructions inside the INSTALL text file which indicate that I should run the command "CXXFLAGS='-O3 -fomit-frame-pointer' make" (which I do from the mingW shell).
此操作的输出可在链接(我已链接,而不是发布输出,由于其长度)。如果省略CXXFLAGS或fomit-frame-pointer标志,或者如果我使用mingw32-make或make all命令,输出不会变化太多。
The output from this operation can be found at link (I've linked rather then posting the output due to its length). The output doesn't vary much if I omit the CXXFLAGS or the fomit-frame-pointer flags or if I use the mingw32-make or make all commands.
似乎抱怨缺少文件,例如
It seems to be complaining about missing files such as
Makefile:56 :../src/latlon.d:没有这样的文件或目录
Makefile:56: ../src/latlon.d: No such file or directory
虽然我可以确认它们存在于目录中。它也在抱怨别的东西。
though I can confirm they exist in the directory stated. It is also complaining about something else
c:/ mingw / bin /../ lib / gcc / mingw32 / 4.7.0 /。 ./../../libmingw32.a(main.o):main.c:(.tex
t.startup + 0xa7):未定义引用_WinMain @ 16'collect2。 exe:
/c/users/gibbons/desktop/libnoisesrc-1.0.0/noise/src'make: *
错误:ld返回1退出状态make [1]:*** [libnoise.so.0.3]错误
1 make [1]:离开目录
[src]错误2
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../libmingw32.a(main.o):main.c:(.tex t.startup+0xa7): undefined reference to
_WinMain@16' collect2.exe: error: ld returned 1 exit status make[1]: *** [libnoise.so.0.3] Error 1 make[1]: Leaving directory
/c/users/gibbons/desktop/libnoisesrc-1.0.0/noise/src ' make: * [src] Error 2
我不知道如何解决这些问题。 google搜索没有真正变成别的单独的博客 post 。这也没有真正帮助,因为我不确定这是什么意思重命名库名称给它一个正确的DLL扩展。一个全部替换将做。
I have no idea how to address these issues. A google search didn't really turn up much other then a single blog post. Which also didn't really help since I am unsure what it means by "Rename the library name to give it a proper DLL extension. A replace-all will do.".
任何帮助或建议将不胜感激,我真的很困惑! : - /
Any help or advice would be appreciated, I'm really quite stuck! :-/
干杯
额外信息:我正在运行windows 7,64位和
Extra info: I'm running windows 7, 64 bit and (think) I'm on mingW 4.7.0.
推荐答案
- 不要担心
没有此类文件或目录
。这是正常的,请参阅src / Makefile
的底部来解释。 - 不要使用目标
- Don't worry about
No such file or directory
. It's normal, see the bottom ofsrc/Makefile
for explanation. - Don't ever use target
clean
. I couldn't recover from that. Remove all directions to build
.so
files. These are linux files and cannot be built by mingw. Open all theMakefile
s and comment out lines containing.so
, except the lines:
libnoise:libnoise.so libnoise.a libnoise.la
all:libnoise.a libnoise.la libnoise.so.0.3
在上述行中,只删除包含 .so
。这将阻止构建 .so
目标。
In the above lines only remove the words containing .so
. This will prevent building .so
targets.
静态库在 src / .libs / libnoise.a
中。
构建DLL 会有点难度,作者使用Visual Studio构建它。没有makefile目标来构建dll。需要准备几行以处理 win32
目录中的文件,并从中生成库。
Building DLL would be a bit harder, as the authors build it using Visual Studio. There are no makefile targets to build the dll. One would need to prepare a few more lines to process files in win32
directory and produce the library out of it.
这篇关于使用mingw在windows上编译libnoise的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!