glib-2.49.4-msys-x86-staticLib.7z

glib-2.49.4 MSYS 静态库 编译 

export LIBFFI_CFLAGS=" -I/usr/local/lib/libffi-3.2.1/include " \
export LIBFFI_LIBS=" -lffi " \
export ZLIB_CFLAGS=-I/usr/local/include \
export ZLIB_LIBS=-lz \
export CFLAGS=" -I/usr/local/include -O2 -Wall -march=i686 -mms-bitfields -mthreads " \
export CPPFLAGS=" -I/usr/local/include " \
export LDFLAGS=" -L/usr/local/lib " \
export LIBS=' -lpsapi -lws2_32 -lmswsock -lpthread ' ./configure \
--prefix=/usr/local \
--enable-static \
--disable-shared \
--disable-debug \
--disable-gtk-doc \
--with-pcre=internal \
--enable-silent-rules __declspec(dllexport) fix to --> __attribute__((visibility ("default")))
__stdcall _export fix to --> __attribute__((visibility ("default")))
define PNG_IMPEXP __declspec(dllimport) fix to --> define PNG_IMPEXP
__attribute__((visibility ("hidden"))) fix to --> __attribute__((visibility ("default")))
delete all DllMain function config.h
-------------------------------------------
/* #define _GLIB_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern */
#define _GLIB_EXTERN __attribute__((visibility("default"))) ... glib/gmessages.c
-------------------------------------------
#include <sys/types.h>
//#include <sys/socket.h>
//#include <sys/un.h> -------------------------------------------
glib_genmarshal
glib-compile-resources
-------------------------------------------
tests\gobject\Makefile
-------------------------------------------
# glib_genmarshal = $(top_builddir)/gobject/glib-genmarshal
glib_genmarshal = echo gio\tests\Makefile
-------------------------------------------
#glib_compile_resources = $(top_builddir)/gio/glib-compile-resources
glib_compile_resources = echo fix source gio/gtype.h add
-------------------------------------------
void gobj_init(void); gio/gtype.c add
-------------------------------------------
void gobj_init(void)
{
gobject_init ();
} -------------------------------------------
fix tools source
-------------------------------------------
gio/glib-compile-resources.c
gio/glib-compile-schemas.c
gio/gio-querymodules.c
gio/gsettings-tool.c
gio/gresource-tool.c
gio/gdbus-tool.c
gio/gio-tool.c
-------------------------------------------
#include "glib-init.h"
#include "../gobject/gobject.h"
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
------------------------------------------- -------------------------------------------
gobject/glib-genmarshal.c <-- Makefile add $(top_builddir)/gobject/libgobject-2.0.la
gobject/gobject-query.c
-------------------------------------------
#include "glib/glib-init.h"
#include "gobject.h"
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
------------------------------------------- -------------------------------------------
tests\gobject\performance.c
tests\gobject\performance-threaded.c
-------------------------------------------
#include "glib.h"
#include <glib-object.h>
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
------------------------------------------- #include <glib.h>
#include <glib/gprintf.h>
#include <glib-object.h> int main(void)
{
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
g_printf("Hello world!\n");
return 0;
} gcc hello.c `pkg-config --cflags --static --libs glib-2.0 gobject-2.0` -o hello

cpp 中使用时 需加 extern "C"

extern "C" {
#include <glib.h>
#include <glib/gprintf.h>
#include <glib-object.h>
} 链接:http://pan.baidu.com/s/1dFmJmDF 密码:kbsn

glib-2.49.4-msys-x86-staticLib.7z

上一篇:Redis单机版分布式锁实现


下一篇:PHP+jQuery 注册模块的改进之三:使用 Smarty3