Some issues (bugs?) with generated header files
evilrat
evilrat666 at gmail.com
Sat Apr 5 03:49:55 PDT 2014
On Saturday, 5 April 2014 at 10:00:13 UTC, Andre wrote:
> Hi,
>
> i want to generate header (di) files for a library I developed
> and faced some issues.
> The project structure is:
> source
> -wba
> --com
> ---defintions.d
> ---...
> --dispatcher.d
> --...
> --package.d
>
>
> MonoDevelop generated following statement for me:
> C:\D\dmd2\windows\bin\dmd.exe -debug -gc
> "source\wba\com\definitions.d"
> "source\wba\com\docHostUIHandler.d"
> "source\wba\com\oleClientSite.d"
> "source\wba\com\oleInPlaceFrame.d"
> "source\wba\com\oleInPlaceSite.d" "source\wba\com\storage.d"
> "source\wba\com\webBrowserEvents2.d" "source\wba\dispatcher.d"
> "source\wba\main.d" "source\wba\objectForScripting.d"
> "source\wba\package.d" "source\wba\wbWrapper.d"
> "source\wba\webbrowser.d" "source\wba\webBrowserForm.d"
> "-IC:\D\dmd2\src\druntime\import" "-IC:\D\dmd2\src\phobos"
> "-IC:\D\lib\WindowsAPI" -lib "-odobj\Header"
> "-ofJ:\Workspace\Libraries\WebBrowserApplication\bin\Header\wba.lib"
> -H
>
> 3 issues:
>
> 1) While using the header files in another project, the
> package.di file does not work as expected. I cannot use
> statement: import wba;
>
> main.d(3): Error: module wba is in file 'wba.d' which cannot be
> read
> It only works if I rename package.di to package.d
>
>
> 2) property methods doesn't work with header files.
> For this coding:
> @property docHostUIHandler()
> {
> return this._docHostUIHandler;
> }
> This di coding was created:
> @property docHostUIHandler();
>
> While using in another project these errors are raised for
> the line in the di coding:
>
> Error: function declaration without return type. (Note that
> constructors are always named 'this')
> Error: no identifier for declarator docHostUIHandler()
>
>
> 3) How can I specify the output folder for the di files
> and also specify that the same folder structure is used as
> described above (wba, wba/com)
>
> Kind regards
> André
i have little info about this, but let me clear something for you.
- interface generation is outdated/broken
- .di files should be avoided now, this is why import looking for
.d only, but idk why.
- to avoid @property issue you can try adding export
specifier("export @property someProperty()")
-Hd flag allows specify header location, -Hf specify name for
example if you want to write them to directory named "imports"
you call "dmd myfile.d -Hdimports" which save myfile.d to
imports/myfile.di
More information about the Digitalmars-d-learn
mailing list