[Issue 10386] Package import feature breaks with static libraries

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 17 17:55:40 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10386



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-06-17 17:55:39 PDT ---
(In reply to comment #3)
> For tiny files like that, it's a lot more user-friendly to just put the text of
> them in a comment. Otherwise, only a small fraction of people will look at it.

The reason I zipped it is because it has a directory structure, which is always
painful to recreate manually. Here's the zip contents anyway:

./test.d:

-----
module test;

// import lib.foo.bar;  // ok
import lib.foo;  // linker failure

void main()
{
    foo(1);
}
-----

./lib/foo/bar.d
-----
module lib.foo.bar;

void foo(int x)
{
    assert(x == 1);
}
-----

./lib/foo/package.d
-----
module lib.foo;

public import lib.foo.bar;
-----

On Windows compile with:
$ dmd -lib lib\foo\bar.d lib\foo\package.d -offoo.lib
$ dmd test.d foo.lib

On Posix it's probably:

$ dmd -lib lib/foo/bar.d lib/foo/package.d -oflibfoo.a
$ dmd test.d -L-lfoo

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list