编译seaf-daemon,并成功运行(失败不续,因为海文的seaf-daemon好像是对windows并不完全开源)

 3-1】编译问题

 /* Add this computer's name to commit. */

    commit->device_name = g_strdup(seaf->client_name);

char *seafile_client_version1 = "6.2.2";

    commit->client_version = g_strdup (seafile_client_version1); //

 

1>..\daemon\seaf-daemon.cpp(89): error C2664: “gboolean searpc_server_register_function(const char *,void *,const gchar *,gchar *)”: 无法将参数 2 从“overloaded-function”转换为“void *”

1>  ..\daemon\seaf-daemon.cpp(89): note: 上下文不允许消除重载函数的歧义

1>..\daemon\seaf-daemon.cpp(129): error C2664: “gboolean searpc_server_register_function(const char *,void *,const gchar *,gchar *)”: 无法将参数 2 从“overloaded-function”转换为“void *”

1>  ..\daemon\seaf-daemon.cpp(129): note: 上下文不允许消除重载函数的歧义

 

扫描二维码关注公众号,回复: 3437415 查看本文章

没解决: 如果将seaf-daemon.cpp改为seaf-daemon.c,就会报以下的错误:

 

1>..\daemon\seaf-daemon.c(290): error C2057: 应输入常量表达式

1>..\daemon\seaf-daemon.c(290): error C2466: 不能分配常量大小为 0 的数组

1>..\daemon\seaf-daemon.c(290): error C2133: “userNameBuf”: 未知的大小

暂时改为:

const int buf_char_count = 32767; //modify by ckc

char userNameBuf[32767];

ZeroMemory(userNameBuf, buf_char_count);

DWORD buf_dword_count = buf_char_count;

 

 

o\include\seafile.h(50): error C2375: “seafile_get_config”: 重定义;不同的链接

1>  E:\seafile-client-windows\seafile-client-vsqtpro\libseafile_pro\include\seafile-rpc.h(45): note: 参见“seafile_get_config”的声明

因为seafile.h定义了一个:seafile_get_config (SearpcClient *client, const char *key, GError **error);

或者是

1>..\daemon\seaf-daemon.cpp(149): error C2664: “gboolean searpc_server_register_function(const char *,void *,const gchar *,gchar *)”: 无法将参数 2 从“overloaded-function”转换为“void *”

1>  ..\daemon\seaf-daemon.cpp(149): note: 上下文不允许消除重载函数的歧义

 

seafile-rpc.h也定义了一个:char *seafile_get_config (const char *key, GError **error);

这里把seafile-rpc.h的定义和声明注释掉。

其他的类似。都是把seafile-rpc.h的定义和声明注释掉。

 

1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\wspiapi.h(53): error C2894: 模板不能声明为有“C”链接

wspiapi.h被某个包含extern "C"的文件包含了,编译器会以为要用c的方式去编译。。

正确的方法是将该文件改为c文件,不能是cpp文件。

 

 

1>http-tx-mgr.obj : error LNK2001: 无法解析的外部符号 __imp__CertOpenSystemStoreW@8

1>http-tx-mgr.obj : error LNK2001: 无法解析的外部符号 __imp__CertCloseStore@8

1>http-tx-mgr.obj : error LNK2001: 无法解析的外部符号 __imp__CertFindCertificateInStore@24

经查找,CertOpenSystemStoreW在#include <wincrypt.h>中

http://blog.sina.com.cn/s/blog_9cd8465f0102uy5d.html

https://blog.csdn.net/jun2ran/article/details/6489922

需要添加静态库:Crypt32.lib

然后去掉name-bash.c。。

2018-7-28 15:30 成功编译了。

 

 

3-2】ctrl+F5成功运行

1、GLib-GRITCAL **:PCRE library is compiled without UTF8 properties support。

Pcre库是没有utf-8的支持就编译了。

 

所以回去pcre工程中添加预处理器定义:SUPPORT_UTF,再重新编译所有相关的工程。

添加编译好的库,最后重新编译seaf-daemon,就可以出错,但是不崩溃了。

回去重新编译pcre,在config.h中,继续添加 #define SUPPORT_PCRE8 1

,也建议看看pcre_internal.h

然后重新编译各个相关工程。最后得到下

GLIB-CRITICAL **:09:45:56:665: PCRE library is compiled without UTF8 properties support .

回去重新编译pcre,在config.h中,继续添加#define SUPPORT_UCP 1

然后重新编译各个相关工程。最后得到下图,说明已经支持UTF8了。

至此完结。

猜你喜欢

转载自blog.csdn.net/caokunchao/article/details/81276501