Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

getopt is not in scope #170

Open
martenlienen opened this issue Oct 4, 2012 · 13 comments
Open

getopt is not in scope #170

martenlienen opened this issue Oct 4, 2012 · 13 comments

Comments

@martenlienen
Copy link

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

@ghost
Copy link

ghost 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

@ku1ik
Copy link

ku1ik commented Nov 23, 2012

Same here, on Ubuntu 12.10.

@passy
Copy link

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
Copy link

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> ?

@martenlienen
Copy link
Author

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
Copy link

lcoq commented Dec 7, 2012

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

@ku1ik
Copy link

ku1ik commented Dec 7, 2012

@bobbus see here: http://ascii.io/a/1701

@JamesLavin
Copy link

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

@bobbus
Copy link

bobbus commented Dec 7, 2012

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

@leifg
Copy link

leifg commented Jan 14, 2013

What's the status on this?

@ghost
Copy link

ghost commented Jan 14, 2013

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

@leifg
Copy link

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
Copy link

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 pushed a commit to rapportive-oss/jasmine-headless-webkit that referenced this issue Apr 16, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants