简体   繁体   English

为Mingw构建libnoise

[英]Building libnoise for mingw

I am currently trying to install the libnoise library for mingw via a .a file. 我目前正在尝试通过.a文件安装mingw的libnoise库。 I've tried several things but I am not really that much experienced with makefiles. 我已经尝试了几件事,但是我对makefile并没有太多的经验。 I've ran through the included makefile and at the end it throws a "Undefined reference to 'WinMain@16'" 我已经遍历了包含的makefile,最后它抛出了“对WinMain @ 16的未定义引用”

The .lib file does indeed work, but is there any way to compile my program through a .a library? .lib文件确实可以工作,但是有什么方法可以通过.a库编译我的程序吗? I would be glad if someone would show me how to actually make a .a myself since I have no experience and I can't find where to start. 如果有人能告诉我如何实际制作一个.a,我会很高兴,因为我没有经验,也找不到从哪里开始。

I found exactly what to do on libnoise while it came to my mind today. 今天,我想到了要在libnoise上做什么。

1) install libnoise on github from https://github.com/eXpl0it3r/libnoise 1)从https://github.com/eXpl0it3r/libnoise在github上安装libnoise

2) run cmake with entries CMAKE_C_COMPILER:STRING=gcc CMAKE_CXX_COMPILER:STRING=g++ (easiest to do with cmake GUI) 2)使用条目CMAKE_C_COMPILER:STRING = gcc运行cmake(最简单的使用cmake GUI来执行)CMAKE_CXX_COMPILER:STRING = g ++

it is recommended to generate into another folder, perhaps create a new one.I created one in a new one called libnoise-master/lib 建议将其生成到另一个文件夹,也许创建一个新文件夹。我在一个名为libnoise-master / lib的新文件夹中创建了一个

3) inside that, run 3)在里面,运行

make

if make doesn't work you might a) not have set up the PATH variable or b) inside your MinGW/bin you can't find make, but mingw32-make. 如果make不起作用,则可能是a)未设置PATH变量,或b)在MinGW / bin中找不到make,而是mingw32-make。 Either rename it to make or use mingw32-make instead of make 将其重命名为make或使用mingw32-make代替make

after all of that you will generate a .a file if you havent chosen a shared library on step 2 or a .dll if you did 毕竟,如果您在步骤2中没有选择共享库,则将生成一个.a文件;如果您没有,则将生成一个.dll文件。

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

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