Changes between Version 3 and Version 4 of Tutorial/UsingDDL/Basic
- Timestamp:
- 04/22/08 18:40:26 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorial/UsingDDL/Basic
v3 v4 64 64 65 65 auto plugin = linker.loadAndLink("plugin.obj"); 66 linker.checkResolved(plugin); 66 67 67 68 auto helloWorld = plugin.getDExport!(void function(),"plugin.helloWorld")(); 68 69 70 Stdout("calling the helloWorld function"c).newline; 69 71 helloWorld(); 70 72 } 97 99 This lesson differs from the Quick Tutorial in that the helloWorld() method that is bound at runtime, invokes Stdout itself, rather than passing a string back to the host program. 98 100 99 But the difference is more than in just the code: under the hood, Stdout is actually stored in the ''host'' program, not the plugin. If you remove the import for "tango.io.Stdout" from the host program, and recompile, you'll see that the whole mess fails spectacularly:101 But the difference is more than in just the code: under the hood, Stdout is actually stored in the ''host'' program, not the plugin. If you remove the import for "tango.io.Stdout" and/or the "Stdout(...).newline" call from the host program, and recompile, you'll see that the whole mess fails spectacularly: 100 102 101 103 {{{ 102 104 basic 103 Error: cannot resolve symbol '__ModuleInfo_5tango2io6Stdout'105 Error: cannot resolve symbol: [0] unresolved external _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print 104 106 }}} 105 107