View previous topic :: View next topic |
Author |
Message |
Stan Brown
Joined: 08 Jan 2007 Posts: 4
|
Posted: Mon Jan 08, 2007 8:48 am Post subject: Building DWT with GDC (.21) on Win32 |
|
|
Has anyone been able to get DWT to compile with GDC? I keep getting lots of
errors, particularly with OBJIDL.
Code: | import\dwt\internal\ole\win32\OBJIDL.d:39: Error: identifier 'DWORD' is not
defined |
I thought the error may be cause by circular linking problems so I tried
compiling with "-fonly=import\dwt\all". This just results in the compiler
crashing immediately. |
|
Back to top |
|
|
Stan Brown
Joined: 08 Jan 2007 Posts: 4
|
Posted: Thu Jan 11, 2007 7:02 pm Post subject: |
|
|
OK, I figured out the first part. I had to put a bunch of imports in several internal OLE classes to reference std.c.windows.windows and std.c.windows.com. This shouldn't have been needed though since wintypes, which was imported in each instance, has both those modules set as public. I think there is an issue with public imports across packages.
But the assert issue using "-fall" is still a problem. I've looked at the GHC code in question and can't figure out whats broken with it. This only leaves me with having to debug the compiler code . Maybe if I get really bored I may look in to doing that. |
|
Back to top |
|
|
Stan Brown
Joined: 08 Jan 2007 Posts: 4
|
Posted: Sun Jan 14, 2007 9:34 pm Post subject: |
|
|
Got it! It wasn't easy or pretty, but I was able to run a simple Hello World app in DWT that was compiled using GDC. A few problems were found that I just skipped for now:
1. I get a duplicate reference error with display.getSortImage. I have no idea why. So I commented it out in that module along with table and tablecolumns.
2. Undefined reference errors for SetLayout and GetLayout in the winapi module. I dummied these out for now. I am thinking the problem is that the latest mingw win32 static libraries are missing these.
3. Some problems with the link widget. I just skipped that module for now.
To compile a release, use the following:
Code: |
gdc -frelease -s -O -finline-functions -fversion=OLE_COM -fversion=DRAG_DROP -c $(IMPORTS) -o all.o
|
Where IMPORTS is just replace with every D module name for DWT.
Compile your application with -mthreads to support threading.
Pragma(lib) doesn't work with GDC, so you need to manually link in all the static libraries yourself. Order is important:
Code: |
-ldwt -lgphobos -ladvapi32 -lcomctl32 -lgdi32 -lshell32 -lcomdlg32 -lole32
-luuid -luser32 -limm32 -lshell32 -lmsimg32 -lgdi32 -lkernel32 -lusp10 -lolepro32 -loleaut32 -loleacc
| [/code] |
|
Back to top |
|
|
|