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

macos 编译不通过? #155

Open
wenfh2020 opened this issue Dec 11, 2020 · 2 comments
Open

macos 编译不通过? #155

wenfh2020 opened this issue Dec 11, 2020 · 2 comments

Comments

@wenfh2020
Copy link

  • 系统。
# [...]$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.1
BuildVersion:	19B88

  • 编译问题。
co_hook_sys_call.cpp:942:42: error: too few arguments to function call, expected 6, have 1
        return g_sys_gethostbyname_r_func( name );
               ~~~~~~~~~~~~~~~~~~~~~~~~~~       ^
1 error generated.
make: *** [co_hook_sys_call.o] Error 1
@notfresh
Copy link

notfresh commented Apr 5, 2021

Yes, I have met the same issue, but not only on MacOS, but also on Linux.

The mac compile error is :

➜  build git:(master) ✗ make
Consolidate compiler generated dependencies of target colib_static
[  3%] Building CXX object CMakeFiles/colib_static.dir/co_hook_sys_call.cpp.o
/Users/zxzx/projects/cpp-projects/libco/co_hook_sys_call.cpp:942:42: error: too few arguments to function call, expected 6, have 1
        return g_sys_gethostbyname_r_func( name );
               ~~~~~~~~~~~~~~~~~~~~~~~~~~       ^
1 error generated.
make[2]: *** [CMakeFiles/colib_static.dir/co_hook_sys_call.cpp.o] Error 1
make[1]: *** [CMakeFiles/colib_static.dir/all] Error 2
make: *** [all] Error 2

the linux compile error is

ar -rc libcolib.a.tmp co_epoll.o co_routine.o co_hook_sys_call.o coctx_swap.o coctx.o co_comm.o ; if [ $? -ne 0 ]; then exit 1; fi; test -d ./lib || mkdir -p ./lib; mv -f libcolib.a.tmp ./lib/libcolib.a;
g++ -fPIC -shared -O2 -pipe -L./solib/ -o  libcolib.so.tmp co_epoll.o co_routine.o co_hook_sys_call.o coctx_swap.o coctx.o co_comm.o ; if [ $? -ne 0 ]; then exit 1; fi; test -d ./solib || mkdir -p ./solib; mv -f libcolib.so.tmp ./solib/libcolib.so;
co_epoll.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
make: *** [Makefile:50: libcolib.so] Error 1

@hobby
Copy link

hobby commented Jul 10, 2023 via email

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

3 participants