getopt is not in scope #170

Open
cqql opened this Issue Oct 4, 2012 · 13 comments

Projects

None yet

8 participants

cqql commented Oct 4, 2012

It seems that in recent versions getopt() has been moved in it's own file, which prevents compilation of the spec runner. This can be fixed with

#include <getopt.h>

I am on Arch Linux using Qt 4.8.3

kelonye commented Oct 8, 2012
specrunner.cpp: In function ‘int main(int, char**)’:
specrunner.cpp:37:39: error: ‘getopt’ was not declared in this scope
specrunner.cpp:43:20: error: ‘optarg’ was not declared in this scope
specrunner.cpp:48:7: error: ‘optind’ was not declared in this scope
specrunner.cpp:61:16: error: ‘optind’ was not declared in this scope
sickill commented Nov 23, 2012

Same here, on Ubuntu 12.10.

passy commented Nov 23, 2012

Same for me. Not sure on what that depends, but I'm running Fedora 17 with gcc 4.7.2 20120921 and glibc-devel-2.15.

bobbus commented Dec 6, 2012

Could you please explain how did you make a workaround for this ? In which file did you add the #include <getopt.h> ?

cqql commented Dec 6, 2012

You add it somewhere before line 37 in specrunner.cpp. You see this when you look at the error message that was posted above. Or even better, look at your own error message.

lcoq commented Dec 7, 2012

Same here on Ubutu 12.10 amd64. This fix worked for me.

Thank you so much, @sickill! That works for me! I've been banging my head against this problem a long time.

bobbus commented Dec 7, 2012

Thanks a lot @sickill , it's working fine now

leifg commented Jan 14, 2013

What's the status on this?

kelonye commented Jan 14, 2013

@leifg tip solves this, could this be kindly closed 😄

leifg commented Jan 14, 2013

I know, but I don't see changing a cpp file as a solution.

If this will be the final solution, I can provide a Pull Request

lcoq commented Jan 14, 2013

@leifg I just pull requested this fix (PR #175). I do not know either if this should be the final solution, but the PR is here!

@ConradIrwin ConradIrwin pushed a commit to rapportive-oss/jasmine-headless-webkit that referenced this issue Apr 16, 2013
Conrad Irwin Import getopt explicitly [Fixes #170] 93c3142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment