Closed ibalashov closed 9 years ago
Thanks for reporting this. It looks like we need to add "#include <cmath>" to the top of neural2d-core.cpp. (I do not have a Mac on which to test this. Please leave a comment here or open a new issue if that fails to fix the problem.)
@davidrmiller Thanks! Adding the include got me past this error. However, now I'm getting:
neural2d$ make
g++ -std=c++11 -pthread -g -O2 -Wall -Wextra -pedantic -Wno-missing-field-initializers -c neural2d-core.cpp -o neural2d-core.o
g++ -std=c++11 -pthread -g -O2 -Wall -Wextra -pedantic -Wno-missing-field-initializers -c webserver.cpp -o webserver.o
webserver.cpp:229:12: error: invalid operands to binary expression ('int' and '__bind<int &, sockaddr *, unsigned long>')
if (-1 == bind(socketFd, (struct sockaddr *)&stSockAddr, sizeof(stSockAddr))) {
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [webserver.o] Error 1
The cause of this error is that the code uses "using namespace std;" to solve this you have to change bind to ::bind.
@jeandudey Thanks! It solved the problem, except the warning which I guess might be ignored:
clang: warning: argument unused during compilation: '-pthread'
:+1:
I checked in 3f5372a6420fb38b3dea7090533d60d11afc72d8 to address the issue with the math and ::bind(). Thanks @jeandudey and @ibalashov for the contributions and testing.
Make project on OS X gives the error below. Any ideas if this could be fixed?
OS X 10.9.5 gcc: stable 4.9.2 (bottled)