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

Issus with getopt #9

Closed
charleslaw opened this issue Sep 25, 2015 · 2 comments
Closed

Issus with getopt #9

charleslaw opened this issue Sep 25, 2015 · 2 comments

Comments

@charleslaw
Copy link

I am still new to Dlang, so it's possible this is user error. I am using:

$dmd -v
DMD64 D Compiler v2.065

I tried including dunit in a project I am building and I get these errors when I just have the dependency in dub.json & the import statement in my app.d:

Running dmd...
../../../.dub/packages/d-unit-0.7.2/src/dunit/framework.d(57): Error: undefined identifier GetoptResult
../../../.dub/packages/d-unit-0.7.2/src/dunit/framework.d(71): Error: undefined identifier GetOptException
../../../.dub/packages/d-unit-0.7.2/src/dunit/framework.d(73): Error: undefined identifier exception, did you mean class Exception?
../../../.dub/packages/d-unit-0.7.2/src/dunit/framework.d(81): Error: undefined identifier defaultGetoptPrinter

I believe the getopt interface has changed because I can build the following, which uses getopt pretty differently to how dunit uses it:

import std.getopt;

string data = "file.dat";
int length = 24;
bool verbose;

void main(string[] args)
{
  getopt(
    args,
    "length",  &length,    // numeric
    "file",    &data,      // string
    "verbose", &verbose   // flag
  );
}
@charleslaw
Copy link
Author

@linkrope
Copy link
Owner

Consider updating your compiler: DMD 2.065 was released in February, 2014. For D programmers, that's ages ago. The latest release is 2.068.2. The green "passing" has been determined with 2.067.0, and the missing getopt behavior was introduced in this release. You need at least 2.067.0 to use v0.7.2 of dunit.

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

No branches or pull requests

2 participants