mosra / magnum-examples

Examples for the Magnum C++11 graphics engine
https://magnum.graphics/
The Unlicense
282 stars 95 forks source link

Viewer example closes at startup... #94

Closed jquiver closed 3 years ago

jquiver commented 3 years ago

Hi, I can't get the viewer example to start on Windows, VS2019 When executing the .parse(argc, argv) the application exists with exit(1) without printing anything. The exact part of the code where this is happening is here (checked with the debugger)

   Utility::Arguments args;
    args.addArgument("file").setHelp("file", "file to load")
        .addOption("importer", "AnySceneImporter").setHelp("importer", "importer plugin to use")
        .addSkippedPrefix("magnum", "engine-specific options")
        .setGlobalHelp("Displays a 3D scene file provided on command line.")
        .parse(arguments.argc, arguments.argv); 

An I missing some arguments when executing the application, if yes how to pass them? Thansk!

Jquiver

jquiver commented 3 years ago

solved, I was using the wrong version of magnum. Great project, keep up the good work.

mosra commented 3 years ago

Hi,

just for the record, it should print something like

Missing command-line argument file
Usage:
  magnum-viewer [--magnum-...] [-h|--help] [--importer IMPORTER] [--] file

and you're expected to run it as magnum-viewer somefile.obj. However, assuming you're running from within VS, the "missing output" is probably due to https://github.com/mosra/corrade/issues/79 -- the output is printed to standard error, but VS for some reason ignores that and displays only what was passed to OutputDebugString(). This is something I still need to fix.