Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 3 and Version 4 of Tutorial/UsingDDL/Basic

Show
Ignore:
Author:
h3r3tic (IP: 89.229.31.215)
Timestamp:
04/22/08 18:40:26 (16 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial/UsingDDL/Basic

    v3 v4  
    6464 
    6565    auto plugin = linker.loadAndLink("plugin.obj"); 
     66    linker.checkResolved(plugin); 
    6667 
    6768    auto helloWorld = plugin.getDExport!(void function(),"plugin.helloWorld")(); 
    6869 
     70    Stdout("calling the helloWorld function"c).newline; 
    6971    helloWorld(); 
    7072} 
    9799This 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.   
    98100 
    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: 
     101But 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: 
    100102 
    101103{{{ 
    102104basic 
    103 Error: cannot resolve symbol '__ModuleInfo_5tango2io6Stdout' 
     105Error: cannot resolve symbol: [0] unresolved external _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print 
    104106}}} 
    105107