harmonia & build

Andrew Fedoniouk news at terrainformatica.com
Sat Mar 11 20:18:58 PST 2006


"Hasan Aljudy" <hasan.aljudy at gmail.com> wrote in message 
news:duvka2$1erk$1 at digitaldaemon.com...
> Yeah, I realize the thing about the main function being an implementation 
> detail.
>
> I think when build sees the WinMain() in the win32application.d it will 
> try to build an executable.
>
> Now, win32application.d is eventually seen by "build" as it tries to add 
> the imported files.
>
> The problem is, When I tried this yesterday, harmonia was inside the 
> phobos source directory; it turned out that build "ignores" phobos 
> modules!! I discovered this when I used the -V switch on build.
>
> I tried to move harmonia to somewhere else, and it seemed to work better, 
> but still produces errors.
>
> There were a couple of problems ..
> First, harmonia uses a different version of std.boxer from what's in 
> phobos.
> I had to change the std.boxer that came with harmonia to somethign else (I 
> made it hboxer) and edit a couple of files to fix the imports.

I tried to use boxter from phobos but D does not like templates to be
in library. Did something change in this area?


>
> The second problem was, some modules have names that don't match the path 
> where they reside, so I had to fix those. e.g. harmonia/string.d is module 
> harmonia.utils.string
>
> When I fixed all that, I got a series of errors along the lines of ..
>
> ------------------------------------------------------------------
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 090E3H Record Type 0091
>  Error 1: Previous Definition Different : _MAILSLOT_NO_MESSAGE
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 090FFH Record Type 0091
>  Error 1: Previous Definition Different : _MAILSLOT_WAIT_FOREVER
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 0911AH Record Type 0091
>  Error 1: Previous Definition Different : _INVALID_HANDLE_VALUE
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 09139H Record Type 0091
>  Error 1: Previous Definition Different : _INVALID_SET_FILE_POINTER
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 09157H Record Type 0091
>  Error 1: Previous Definition Different : _INVALID_FILE_SIZE
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 092DEH Record Type 0091
> (......)
> ------------------------------------------------------------------
>
> and so on ..
>
> The good news is, build was trying to build an .exe
> This is what I got before the error list:
>
> ---------------------------------------------------------------------
> Wrong conversion!
> TODO: selected and value attributes
> TODO: selected and value attributes
> TODO (cursorSize): make this through SystemMetrics
> C:\dmd\bin\..\..\dm\bin\link.exe 
> C:\dmd\src\other\harmonia\themes\theme+((..........))+C:\dmd\src\other\harmonia\ui\controls\editbox,browser.exe,,gdi32.lib+user32+kernel32,browser.def/noi;
>
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> -----------------------------------------------------------------------
>
> I thought the clurpit was hboxer (the boxer module that harmonia uses), I 
> just thought that maybe for some reason, the linker thinks the boxer 
> implementation is in phobos.lib
>
> I tried to edit harmonia to use the std.boxer in phobos, it wasn't easy or 
> fun at all, and in the end I still got the exact same kind of errors 
> above.
>
> I thought maybe it's the windows headers that harmonia uses, but at that I 
> was tired of trying to fix it. So I stopped working on it.
>
> Does anyone know what does this kind of error messege indicates?
>
> C:\dmd\bin\..\lib\phobos.lib(windows)  Offset 090E3H Record Type 0091
>  Error 1: Previous Definition Different : _MAILSLOT_NO_MESSAGE
>

I suspect that this means that windows.d defintions were included twice.
Harmonia has its own set of Win API deifinitions.

BTW: what will happen if you will just run build.bat from harmonia root 
folder?
Will it build samples on your machine?

Andrew.


> Andrew Fedoniouk wrote:
>> "Hasan Aljudy" <hasan.aljudy at gmail.com> wrote in message 
>> news:dutvqf$1pek$1 at digitaldaemon.com...
>>
>>>build expects to see a "main" function inside the file sent to it thru 
>>>the command line.
>>>Harmonia doesn't work that way. The main function is somewhere else!!
>>
>>
>> 1) Windows GUI application has WinMain() function instead of main().
>> 2) Harmonia tries to isolate you from this platform specific details 
>> (e.g. you don't need to reproduce "message pump" in each your 
>> application), this is why WinMain function is a part of Harmonia 
>> implementation. You don't need to write WinMain each time.
>>
>> Please see:
>> http://harmonia.terrainformatica.com/pmwiki.php/Harmonia/HarmoniaApplication
>>
>>
>>>How can I get build to realize this fact and properly invoke the linker 
>>>to build an exe file instead of a lib file?
>>
>>
>>>I tried passing the win32application.d file to build, but I got some 
>>>wierd link errors!
>>
>>
>> I don't know. Would appreciate if someone will tell me.
>> You should be able to pass to build.exe name of your main.d file and
>> build target type - exe.
>>
>> Probably build.exe needs some additional flags in command line? I don't 
>> know.
>>
>> Andrew Fedoniouk.
>> http://terrainformatica.com
>>
>>
>>
> 





More information about the Digitalmars-d-dwt mailing list