如何从 github 上的源代码进行编译?
How do I compile from source on github?
首先:事情是这样的。
https://github.com/oscar-broman/sky
应该编译成.dll
我不知道从哪里开始,但我在 cygwin 中尝试过 'make'。这显然是错误的方法...
$ make
rm -f *~ *.o *.so
gcc -m32 -D SKY -g -c -fPIC -w -D LINUX ./lib/sdk/*.cpp
In file included from ./lib/sdk/plugin.h:8:0,
from ./lib/sdk/amxplugin.cpp:13:
./lib/sdk/plugincommon.h:40:4: error: #error "Unknown operating system."
#error "Unknown operating system."
^
In file included from ./lib/sdk/plugin.h:9:0,
from ./lib/sdk/amxplugin.cpp:13:
./lib/sdk/amx/amx.h:381:72: error: ‘size_t’ has not been declared
int AMXAPI amx_GetString(char *dest,const cell *source, int use_wchar, size_t size);
^
./lib/sdk/amx/amx.h:401:83: error: ‘size_t’ has not been declared
int AMXAPI amx_SetString(cell *dest, const char *source, int pack, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:142:86: error: ‘size_t’ has not been declared
typedef int AMXAPI (*amx_GetString_t)(char *dest,const cell *source, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:143:72: error: ‘size_t’ has not been declared
int AMXAPI amx_GetString(char *dest,const cell *source, int use_wchar, size_t size)
^
./lib/sdk/amxplugin.cpp:282:97: error: ‘size_t’ has not been declared
typedef int AMXAPI (*amx_SetString_t)(cell *dest, const char *source, int pack, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:283:83: error: ‘size_t’ has not been declared
int AMXAPI amx_SetString(cell *dest, const char *source, int pack, int use_wchar, size_t size)
^
makefile:22: recipe for target 'SKY' failed
make: *** [SKY] Error 1
而且我认为 gcc 是 installed
我需要做些什么来编译该源代码?
我看了代码。此代码预计在 GNU/Linux、FreeBSD 或 OpenBSD 上使用 GCC 编译,或者在 Windows 上使用 MS Visual C++ 编译。它不支持使用 GCC (cygwin) 在 Windows 上编译。
至于格式化,如果您 read the docs 而不是仅仅猜测很多不同的东西,那么使它起作用会容易得多。
首先:事情是这样的。 https://github.com/oscar-broman/sky
应该编译成.dll
我不知道从哪里开始,但我在 cygwin 中尝试过 'make'。这显然是错误的方法...
$ make
rm -f *~ *.o *.so
gcc -m32 -D SKY -g -c -fPIC -w -D LINUX ./lib/sdk/*.cpp
In file included from ./lib/sdk/plugin.h:8:0,
from ./lib/sdk/amxplugin.cpp:13:
./lib/sdk/plugincommon.h:40:4: error: #error "Unknown operating system."
#error "Unknown operating system."
^
In file included from ./lib/sdk/plugin.h:9:0,
from ./lib/sdk/amxplugin.cpp:13:
./lib/sdk/amx/amx.h:381:72: error: ‘size_t’ has not been declared
int AMXAPI amx_GetString(char *dest,const cell *source, int use_wchar, size_t size);
^
./lib/sdk/amx/amx.h:401:83: error: ‘size_t’ has not been declared
int AMXAPI amx_SetString(cell *dest, const char *source, int pack, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:142:86: error: ‘size_t’ has not been declared
typedef int AMXAPI (*amx_GetString_t)(char *dest,const cell *source, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:143:72: error: ‘size_t’ has not been declared
int AMXAPI amx_GetString(char *dest,const cell *source, int use_wchar, size_t size)
^
./lib/sdk/amxplugin.cpp:282:97: error: ‘size_t’ has not been declared
typedef int AMXAPI (*amx_SetString_t)(cell *dest, const char *source, int pack, int use_wchar, size_t size);
^
./lib/sdk/amxplugin.cpp:283:83: error: ‘size_t’ has not been declared
int AMXAPI amx_SetString(cell *dest, const char *source, int pack, int use_wchar, size_t size)
^
makefile:22: recipe for target 'SKY' failed
make: *** [SKY] Error 1
而且我认为 gcc 是 installed
我需要做些什么来编译该源代码?
我看了代码。此代码预计在 GNU/Linux、FreeBSD 或 OpenBSD 上使用 GCC 编译,或者在 Windows 上使用 MS Visual C++ 编译。它不支持使用 GCC (cygwin) 在 Windows 上编译。
至于格式化,如果您 read the docs 而不是仅仅猜测很多不同的东西,那么使它起作用会容易得多。