MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / main

Function main

examples/plugin-hosts/BasicPluginLoader.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include <exception>
35
36int main(int argc, char *argv[]) {
37 if (argc < 2) {
38 std::cerr << "Must supply a plugin name to load." << std::endl;
39 return 1;
40 }
41 osvr::pluginhost::RegistrationContext ctx;
42
43 try {
44 std::cout << "Trying to load plugin " << argv[1] << std::endl;
45 ctx.loadPlugin(argv[1]);
46 std::cout << "Successfully loaded plugin, control returned to host "
47 "application!" << std::endl;
48 return 0;
49 } catch (std::exception &e) {
50 std::cerr << "Caught exception tring to load " << argv[1] << ": "
51 << e.what() << std::endl;
52 return 1;
53 }
54 std::cerr << "Failed in a weird way - not a std::exception." << std::endl;
55 return 2;
56}

Callers

nothing calls this directly

Calls 1

loadPluginMethod · 0.45

Tested by

no test coverage detected