What's up with GDC?
Mike Parker via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jun 11 20:11:14 PDT 2016
On Sunday, 12 June 2016 at 01:51:05 UTC, Joerg Joergonson wrote:
>
> Well, it's definitely not as simple as you make it out to be. I
> have tried all kinds of combinations of libs and settings and
> nothing works. If it's not one error it's another and it
> becomes hard to know exactly what is going on because the
> people who created these applications didn't have the
> forethought to give meaningful error messages.
>
> I believe the main problem now is that ldc is not linking
> phobo's or runtime or whatever because I get all kinds of weird
> export issues.
>
>
> with x86 ldc I get
>
> Error: module libsmBase is in file 'libsmBase.d' which cannot
> be read.
>
> The module though is actually mBase and it is in libs\mBase. It
> removing the directory.
>
> From the build:
>
> echo libs\mBase.d >"Win32\Debug LDC\Test.build.rsp"
>
> So, not sure if the error is just leaving out the '\' or what.
> Irregardless, please don't act like all this is my problem
> because most of it is due to crappy design and forethought.
This is a compiler error, not a linker error. "module foo is in
file 'foo.d'" is the error you normally see when you've got a
problem with your import path, or imported the wrong module name.
Obviously, there's an issue here with the directory name being
pushed onto the module name, but I can't even begin to guess why
that happened. I assume you've imported mBase in another module.
What was your import statement? Do you have a module declaration
in mBase.d?
And I know you're frustrated, but please don't blame 'crappy
design and forethought'. Plenty of people are using these tools
just fine. That doesn't mean that there won't be bugs in them, or
that they are implemented to the point that someone unfamiliar
with them can use them out of the box. VisualD is developed by
one person in his spare time. The LDC team is also small and work
in their spare time. I think they've done a great job getting as
far as they have. Once we figure out what your issue is, then you
should be golden.
>
> Maybe I am suppose to include the subdirs in my project in
> visual studio/D and the error message simply cannot find the
> modules? But how am I suppose to know that with an illogical
> error message like what is above?
That's not an illogical error message. It's coming from the DMD
front end, which all of the major D compilers share. Anytime you
see it, it means you've got an issue with your import path. I've
never seen the specific error you've got, where the directory
name is merged with the file name. That *is* weird, but the error
message itself is normally very useful.
>
> DMD works fine BTW. GDC and LDC should be a drop in
> replacement. Not a totally new setup that has it's own set of
> problems. I'm sure I'm not the only one put off by the
> compounding of problems when using D.
I think that's reasonable. All three compilers share the same
fronted, but beyond that, they are quite different. IIRC, LDC
does recognize some DMD switched, and there is a tool called GDMD
that allows you to invoke GDC as if you were invoking DMD, but
you can't expect the compilers to be drop-in replacements for
each other. GDC has to fit in with the GCC ecosystem, which means
it accepts a number of command line options that DMD does not
support, and any that are specific to D must be consistent with
other GCC tools in format. LDC also is a completely different
tool. There will always be differences that prevent them from
being interchangeable, which is why we have build tools and IDEs
to hide the differences from us.
More information about the Digitalmars-d-learn
mailing list