getopt is not in scope #170

Open
opened 2012-10-04 01:04:24 +00:00 by martenlienen · 13 comments
martenlienen commented 2012-10-04 01:04:24 +00:00 (Migrated from github.com)

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

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 2012-10-08 21:46:38 +00:00 (Migrated from github.com)
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
``` 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 2012-11-23 20:38:04 +00:00 (Migrated from github.com)

Same here, on Ubuntu 12.10.

Same here, on Ubuntu 12.10.
passy commented 2012-11-23 20:54:20 +00:00 (Migrated from github.com)

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.

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 2012-12-06 15:17:04 +00:00 (Migrated from github.com)

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

Could you please explain how did you make a workaround for this ? In which file did you add the `#include <getopt.h>` ?
martenlienen commented 2012-12-06 19:39:00 +00:00 (Migrated from github.com)

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.

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 2012-12-07 09:47:50 +00:00 (Migrated from github.com)

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

Same here on Ubutu 12.10 amd64. This fix worked for me.
sickill commented 2012-12-07 14:30:06 +00:00 (Migrated from github.com)

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

@bobbus see here: http://ascii.io/a/1701
JamesLavin commented 2012-12-07 14:53:51 +00:00 (Migrated from github.com)

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

Thank you so much, @sickill! That works for me! I've been banging my head against this problem a long time.
bobbus commented 2012-12-07 15:00:29 +00:00 (Migrated from github.com)

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

Thanks a lot @sickill , it's working fine now
leifg commented 2013-01-14 12:26:15 +00:00 (Migrated from github.com)

What's the status on this?

What's the status on this?
kelonye commented 2013-01-14 12:30:38 +00:00 (Migrated from github.com)

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

@leifg tip solves this, could this be kindly closed :smile:
leifg commented 2013-01-14 12:34:44 +00:00 (Migrated from github.com)

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

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 2013-01-14 12:36:26 +00:00 (Migrated from github.com)

@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!

@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!
Sign in to join this conversation.
No Label
bug
doc
feature
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: github-migration/jasmine-headless-webkit#170
No description provided.