简体   繁体   English

使用mingw在windows上编译libnoise

[英]Compiling libnoise on windows with mingw

This is my first post here so forgive me if I've done something wrong. 这是我在这里的第一篇文章,如果我做错了,请原谅我。

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. 简而言之,我想使用mingw在windows上编译libnoise(1.0.0)。 However, there seems to be a lack of information available online. 但是,似乎缺乏在线提供的信息。

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). 我已从网站下载了源文件,并按照INSTALL文本文件中的说明进行操作,该文件指示我应该运行命令“CXXFLAGS =' - O3 -fomit-frame-pointer'make”(我在mingW shell中执行此操作) 。

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. 如果我省略CXXFLAGS或fomit-frame-pointer标志或者如果我使用mingw32-make或make all命令,输出变化不大。

It seems to be complaining about missing files such as 它似乎抱怨丢失的文件,如

Makefile:56: ../src/latlon.d: No such file or directory Makefile:56:../ src /latlon.d:没有这样的文件或目录

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): 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 c:/ mingw / bin /../ lib / gcc / mingw32 / 4.7.0 /../../../ libmingw32.a(main.o):main.c :(。tex t.startup + 0xa7 ):未定义引用_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'化妆:* [SRC]错误2

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.". 这也没有真正帮助,因为我不确定它是什么意思“重命名库名称给它一个合适的DLL扩展。替换所有将做。”。

Any help or advice would be appreciated, I'm really quite stuck! 任何帮助或建议将不胜感激,我真的很卡住了! :-/ : - /

Cheers 干杯

Extra info: I'm running windows 7, 64 bit and (think) I'm on mingW 4.7.0. 额外的信息:我正在运行Windows 7,64位和(想)我在使用4.7.0。

  1. Don't worry about No such file or directory . 不要担心No such file or directory It's normal, see the bottom of src/Makefile for explanation. 这是正常的,请参阅src/Makefile的底部以获得解释。
  2. Don't ever use target clean . 不要使用目标clean I couldn't recover from that. 我无法从中恢复过来。
  3. Remove all directions to build .so files . 删除构建.so文件的所有方向 These are linux files and cannot be built by mingw. 这些是linux文件,不能由mingw构建。 Open all the Makefile s and comment out lines containing .so , except the lines: 打开所有Makefile并注释掉包含.so的行,除了行:

    libnoise: libnoise.so libnoise.a libnoise.la
    all: libnoise.a libnoise.la libnoise.so.0.3

    In the above lines only remove the words containing .so . 在上面的行中只删除包含.so的单词。 This will prevent building .so targets. 这将阻止建立.so目标。

Find the static library in src/.libs/libnoise.a . src/.libs/libnoise.a找到静态库

Building DLL would be a bit harder, as the authors build it using Visual Studio. 构建DLL会有点困难,因为作者使用Visual Studio构建它。 There are no makefile targets to build the dll. 没有makefile目标来构建dll。 One would need to prepare a few more lines to process files in win32 directory and produce the library out of it. 人们需要准备几行来处理win32目录中的文件并从中生成库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM