Compiling libnoise on windows with mingw

This is my first post, so forgive me if I did something wrong.

I struggled with this for several days, and I finally decided to give in and ask for help. Simply put, I would like to compile libnoise (1.0.0) on windows using mingw. However, there appears to be no available information on the Internet.

I 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 am doing from mingW).

The result of this operation can be found in the link (I linked and then published the output because of its length). The output is not much different if I omit the CXXFLAGS or fomit-frame-pointer flags or if I use mingw32-make or create all the commands.

It seems to complain about missing files such as

Makefile: 56: ../ src / latlon.d: no such file or directory

although I can confirm that they exist in the specified directory. He also complains about something else.

C: / MinGW / bin /../ Library / GCC / mingw32 / 4.7.0 /../../../ libmingw32.a (main.o): main.c :( tex. T.startup + 0xa7 ): undefined link 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

I do not know how to solve these problems. As a result of a Google search, there really wasn’t much more than one post blog. Which also did not help, since I'm not sure what this means: "Rename the library name to give it a proper .dll extension.

Any help or advice would be appreciated, I'm really stuck !: - /

Greetings

Additional Information: I am running windows 7, 64 bit and (I think) I am on mingW 4.7.0.

+4
source share
1 answer
  • Do not worry about No such file or directory . This is normal, see Bottom of src/Makefile for an explanation.
  • Never use a clean target. I could not recover from this.
  • Remove all instructions for creating .so files . These are linux files and cannot be created using mingw. Open all the lines of the Makefile and comments containing .so , with the exception of the lines:

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

    In the lines above, only words containing .so are deleted. This will prevent the creation of .so objects.

Find the static library in src/.libs/libnoise.a .

Creating a DLL will be a bit more complicated, as authors create it using Visual Studio. There are no makefile targets for creating a dll. We need to prepare a few more lines for processing files in the win32 directory and release the library from it.

+3
source

Source: https://habr.com/ru/post/1444706/


All Articles