Error occurred when make
xiangpdu opened this issue · 4 comments
$ make
g++ -DPOSIX -std=c++14 -c -Wall -O2 src/socket/Socket.cpp -o build/obj/socket/Socket.o
In file included from /usr/include/x86_64-linux-gnu/bits/byteswap.h:35:0,
from /usr/include/endian.h:60,
from /usr/include/x86_64-linux-gnu/sys/types.h:216,
from src/socket/../system/System.h:30,
from src/socket/Socket.h:3,
from src/socket/Socket.cpp:2:
src/socket/Socket.cpp: In member function ‘bool Socket::Socket::bind(int) const’:
src/socket/Socket.cpp:108:6: error: expected id-expression before ‘(’ token
::htons(port),
^
make: *** [build/obj/socket/Socket.o] Error 1
Can you provide the description of you solution? "fixed issue #6" show nothing of the solution.
Of course
httpserver/src/socket/Socket.cpp
Lines 106 to 107 in d824fe7
If this fix should apply to all this functions like htons, htonl and so on?
Yes, it should help in such cases.
But only if macros are used instead of function names.
Not for all compilers and systems it is.