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

Unable to compile -- missing include files #13

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 2 comments
Closed

Unable to compile -- missing include files #13

GoogleCodeExporter opened this issue Mar 15, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. make

What is the expected output? What do you see instead?
./configure runs successfully, however, multiple compile errors after running 
make.  Missing include files.

What version of the product are you using? On what operating system?
Using slowhttptest version 1.4 on Arch Linux using gcc 4.7.

Please provide any additional information below.

After running make:

make  all-recursive
make[1]: Entering directory `/home/phil/slowhttptest-1.4'
Making all in src
make[2]: Entering directory `/home/phil/slowhttptest-1.4/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptestmain.o -MD -MP -MF 
.deps/slowhttptestmain.Tpo -c -o slowhttptestmain.o slowhttptestmain.cc
slowhttptestmain.cc: In function 'bool parse_int(int&, long int)':
slowhttptestmain.cc:114:21: error: 'optarg' was not declared in this scope
slowhttptestmain.cc:116:50: error: 'optopt' was not declared in this scope
slowhttptestmain.cc:120:57: error: 'optopt' was not declared in this scope
slowhttptestmain.cc: In function 'int main(int, char**)':
slowhttptestmain.cc:170:78: error: 'getopt' was not declared in this scope
slowhttptestmain.cc:224:23: error: 'optarg' was not declared in this scope
slowhttptestmain.cc:271:40: error: 'optopt' was not declared in this scope
make[2]: *** [slowhttptestmain.o] Error 1
make[2]: Leaving directory `/home/phil/slowhttptest-1.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/phil/slowhttptest-1.4'
make: *** [all] Error 2


After including "#include <getopt.h>" in slowhttptestmain.cc:

make  all-recursive
make[1]: Entering directory `/home/phil/slowhttptest-1.4'
Making all in src
make[2]: Entering directory `/home/phil/slowhttptest-1.4/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptestmain.o -MD -MP -MF 
.deps/slowhttptestmain.Tpo -c -o slowhttptestmain.o slowhttptestmain.cc
mv -f .deps/slowhttptestmain.Tpo .deps/slowhttptestmain.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptest.o -MD -MP -MF 
.deps/slowhttptest.Tpo -c -o slowhttptest.o slowhttptest.cc
slowhttptest.cc: In member function 'bool 
slowhttptest::SlowHTTPTest::run_test()':
slowhttptest.cc:873:30: error: 'usleep' was not declared in this scope
make[2]: *** [slowhttptest.o] Error 1
make[2]: Leaving directory `/home/phil/slowhttptest-1.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/phil/slowhttptest-1.4'
make: *** [all] Error 2

After including "#include <unistd.h>" in slowhttptestmain.cc:

make  all-recursive
make[1]: Entering directory `/home/phil/slowhttptest-1.4'
Making all in src
make[2]: Entering directory `/home/phil/slowhttptest-1.4/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptest.o -MD -MP -MF 
.deps/slowhttptest.Tpo -c -o slowhttptest.o slowhttptest.cc
mv -f .deps/slowhttptest.Tpo .deps/slowhttptest.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowsocket.o -MD -MP -MF 
.deps/slowsocket.Tpo -c -o slowsocket.o slowsocket.cc
slowsocket.cc: In member function 'void slowhttptest::SlowSocket::close()':
slowsocket.cc:268:3: error: '::close' has not been declared
make[2]: *** [slowsocket.o] Error 1
make[2]: Leaving directory `/home/phil/slowhttptest-1.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/phil/slowhttptest-1.4'
make: *** [all] Error 2

After including "#include <unistd.h>" in slowsocket.cc

make  all-recursive
make[1]: Entering directory `/home/phil/slowhttptest-1.4'
Making all in src
make[2]: Entering directory `/home/phil/slowhttptest-1.4/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptest.o -MD -MP -MF 
.deps/slowhttptest.Tpo -c -o slowhttptest.o slowhttptest.cc
mv -f .deps/slowhttptest.Tpo .deps/slowhttptest.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowsocket.o -MD -MP -MF 
.deps/slowsocket.Tpo -c -o slowsocket.o slowsocket.cc
mv -f .deps/slowsocket.Tpo .deps/slowsocket.Po
g++  -g -O2  -L/usr/local/lib -lssl -o slowhttptest slowhttptestmain.o 
slowhttptest.o slowsocket.o slowstats.o slowurl.o slowlog.o text-generator.o 
range-generator.o  -lssl 
make[2]: Leaving directory `/home/phil/slowhttptest-1.4/src'
Making all in man
make[2]: Entering directory `/home/phil/slowhttptest-1.4/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/phil/slowhttptest-1.4/man'
make[2]: Entering directory `/home/phil/slowhttptest-1.4'
make[2]: Leaving directory `/home/phil/slowhttptest-1.4'
make[1]: Leaving directory `/home/phil/slowhttptest-1.4'

Success!

Original issue reported on code.google.com by phil.beh...@gmail.com on 7 Jun 2012 at 11:17

@GoogleCodeExporter
Copy link
Author

Sorry, didn't see your comment, which makes total sense. Platforms I tested on 
have getopt.h included indirectly by stdlib.h. Thanks!

Original comment by shek...@gmail.com on 16 Jul 2012 at 5:42

@GoogleCodeExporter
Copy link
Author

Original comment by shek...@gmail.com on 26 Aug 2012 at 9:48

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant