Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd编译出错 #14

Closed
samuelyao314 opened this issue May 8, 2013 · 3 comments
Closed

freebsd编译出错 #14

samuelyao314 opened this issue May 8, 2013 · 3 comments

Comments

@samuelyao314
Copy link

在freebsd上编译出现错误,发现是以下3个问题

  1. freebsd系统中dlopen在libc中, makefile中使用 -ldl
  2. freebsd系统中, struct sockaddr_in定义在 #include <netinet/in.h>; 相关的源文件都需要这个头文件, 例如 service-src/service_harbor.c, client-src/client.c等
  3. gate/mread.c 中, #include <sys/types.h>必须在 #include <sys/event.h>之前,否则会报错
@cloudwu
Copy link
Owner

cloudwu commented May 8, 2013

我现在没有 freebsd 可以用, 所以请提一个 pull request :)

@samuelyao314
Copy link
Author

sorry, 因为freebsd在公司的机器的虚拟机上, 一直搞不定git push. 我把我修改后的代码直接发给你吧

修改内容

  1. skynet/makefile中, 修改LDFLAGS, 删掉 -ldl
  2. skynet/gate/mread.c 中, #include <sys/types.h>必须在#include <sys/event.h>之前,
    否则出现类似以下错误
    In file included from mread.c:23: /usr/include/sys/event.h:58: error: expected specifier-qualifier-list before 'uintptr_t'
  3. 所有使用 struct sockaddr_in my_addr的源文件,必须 #include <netinet/in.h>
    实际修改的文件清单如下
    samuel@[pts/0]~/incoming/skynet% find ./ -name '*.c' | xargs grep "struct sockaddr_in "
    ./service-src/service_harbor.c: struct sockaddr_in my_addr;
    ./service-src/service_master.c: struct sockaddr_in my_addr;
    ./client-src/client.c: struct sockaddr_in my_addr;
    ./connection/lua-socket.c: struct sockaddr_in my_addr;
    ./gate/main.c: struct sockaddr_in remote_addr;
    ./gate/mread.c: struct sockaddr_in my_addr;
    ./gate/mread.c: struct sockaddr_in remote_addr;

------------------ 原始邮件 ------------------
发件人: "云风"notifications@github.com;
发送时间: 2013年5月8日(星期三) 中午11:06
收件人: "cloudwu/skynet"skynet@noreply.github.com;
抄送: "samuelyao314"732834509@qq.com;
主题: Re: [skynet] freebsd编译出错 (#14)

我现在没有 freebsd 可以用, 所以请提一个 pull request :)


Reply to this email directly or view it on GitHub.

@cloudwu
Copy link
Owner

cloudwu commented May 8, 2013

done

@cloudwu cloudwu closed this as completed May 8, 2013
@DeanHH DeanHH mentioned this issue Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants