FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problems with windows.d

 
Post new topic   Reply to topic     Forum Index -> Ares
View previous topic :: View next topic  
Author Message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Nov 12, 2005 9:52 pm    Post subject: problems with windows.d Reply with quote

Hi Sean,

I tried compiling some Mango examples with Ares, and ran into some problems. First, there's some duplicate declarations within std.c.windows.windows.d, so I commented out the duplicates. Second, the linker bitches and moans about the same file:

Quote:
C:\D\mango\example>build -DCPATH\d\dmd\bin filecat.d -I.. -O -release -clean -full -version=Ares -I\d\ares\src\ares
C:\d\dmd\bin\..\..\dm\bin\link.exe \d\ares\src\ares\sys\windows\c\windows+\d\ares\src\ares\std\c\signal+C:\D\mango\mango\io\model\IConduit+C
:\D\mango\mango\io\FileStyle+C:\D\mango\mango\sys\Epoch+C:\D\mango\mango\io\FileProxy+filecat+C:\D\mango\mango\io\model\IWriter+\d\ares\src\
ares\std\c\windows\windows+C:\D\mango\mango\io\Utf+C:\D\mango\mango\io\FilePath+C:\D\mango\mango\io\Console+\d\ares\src\ares\std\c\stdint+C:
\D\mango\mango\io\Buffer+C:\D\mango\mango\io\model\IResource+C:\D\mango\mango\io\model\IBuffer+C:\D\mango\mango\io\FileConduit+C:\D\mango\ma
ngo\sys\System+\d\ares\src\ares\std\thread+\d\ares\src\ares\std\c\string+\d\ares\src\ares\sys\windows\c\process+C:\D\mango\mango\io\FileCons
t+C:\D\mango\mango\io\Exception+C:\D\mango\mango\io\Conduit+\d\ares\src\ares\std\c\stddef+C:\D\mango\mango\io\Resource+C:\D\mango\mango\io\D
eviceConduit+C:\D\mango\mango\io\ConduitStyle,filecat.exe,,user32+kernel32,filecat.def/noi;
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved

\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00114H Record Type 0091
Error 1: Previous Definition Different : _MAILSLOT_NO_MESSAGE
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00130H Record Type 0091
Error 1: Previous Definition Different : _MAILSLOT_WAIT_FOREVER
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0014BH Record Type 0091
Error 1: Previous Definition Different : _INVALID_HANDLE_VALUE
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0016AH Record Type 0091
Error 1: Previous Definition Different : _INVALID_SET_FILE_POINTER
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00188H Record Type 0091
Error 1: Previous Definition Different : _INVALID_FILE_SIZE
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 002D8H Record Type 0091
Error 1: Previous Definition Different : _REG_CREATED_NEW_KEY
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 002F6H Record Type 0091
Error 1: Previous Definition Different : _REG_OPENED_EXISTING_KEY
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0030EH Record Type 0091
Error 1: Previous Definition Different : _HKEY_CLASSES_ROOT
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00326H Record Type 0091
Error 1: Previous Definition Different : _HKEY_CURRENT_USER
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00345H Record Type 0091
Error 1: Previous Definition Different : _HKEY_LOCAL_MACHINE
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00356H Record Type 0091
Error 1: Previous Definition Different : _HKEY_USERS
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00372H Record Type 0091
Error 1: Previous Definition Different : _HKEY_PERFORMANCE_DATA
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0038CH Record Type 0091
Error 1: Previous Definition Different : _HKEY_CURRENT_CONFIG
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 003A0H Record Type 0091
Error 1: Previous Definition Different : _HKEY_DYN_DATA
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 006F5H Record Type 0091
Error 1: Previous Definition Different : _IDI_APPLICATION
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00705H Record Type 0091
Error 1: Previous Definition Different : _IDC_ARROW
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00715H Record Type 0091
Error 1: Previous Definition Different : _IDC_CROSS
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00729H Record Type 0091
Error 1: Previous Definition Different : _CW_USEDEFAULT
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0075EH Record Type 0091
Error 1: Previous Definition Different : _HWND_DESKTOP
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00943H Record Type 00C3
Error 1: Previous Definition Different : _HIWORD@4
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0095AH Record Type 00C3
Error 1: Previous Definition Different : _LOWORD@4
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00971H Record Type 00C3
Error 1: Previous Definition Different : _FAILED@4
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 0098AH Record Type 00C3
Error 1: Previous Definition Different : _SUCCEEDED@4
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00DECH Record Type 00C3
Error 1: Previous Definition Different : _CreateWindowA@44
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00E64H Record Type 00C3
Error 1: Previous Definition Different : _MAKEINTRESOURCEA@4
\d\ares\src\ares\std\c\windows\windows.obj(windows) Offset 00E80H Record Type 00C3
Error 1: Previous Definition Different : _RGB@12
--- errorlevel 26

C:\D\mango\example>


It's linking against the Ares replacement for Phobos.lib, and I renamed the phobos (source) directory just in case something was being picked up from there. Any ideas?
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Nov 12, 2005 10:37 pm    Post subject: Reply with quote

Hmmm. Most of that is due to the linker being told to use the /ares files noted above, while it finds them in the library also. There shouldn't be a conflict there, should there?

Anyway, Build has a -X option to evade this problem. That got me this far:

Quote:
C:\D\mango\example>build -DCPATH\d\dmd\bin filecat.d -I.. -O -release -version=Ares -I\d\ares\src\ares -full -X\d\ares -clean
C:\d\dmd\bin\..\..\dm\bin\link.exe C:\D\mango\mango\io\model\IConduit+C:\D\mango\mango\io\FileStyle+C:\D\mango\mango\sys\Epoch+C:\D\mango\ma
ngo\io\FileProxy+filecat+C:\D\mango\mango\io\model\IWriter+C:\D\mango\mango\io\Utf+C:\D\mango\mango\io\FilePath+C:\D\mango\mango\io\Console+
C:\D\mango\mango\io\Buffer+C:\D\mango\mango\io\model\IResource+C:\D\mango\mango\io\model\IBuffer+C:\D\mango\mango\io\FileConduit+C:\D\mango\
mango\sys\System+C:\D\mango\mango\io\Exception+C:\D\mango\mango\io\FileConst+C:\D\mango\mango\io\Conduit+C:\D\mango\mango\io\Resource+C:\D\m
ango\mango\io\DeviceConduit+C:\D\mango\mango\io\ConduitStyle,filecat.exe,,user32+kernel32,filecat.def/noi;
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved

C:\D\mango\mango\io\FileProxy.obj(FileProxy)
Error 42: Symbol Undefined __init_3std1c7windows7windows16WIN32_FIND_DATAW
--- errorlevel 1

C:\D\mango\example>


If I comment out the code using WIN32_FIND_DATAW, then it links correctly. Does this indicate a dodgy windows.obj within the Ares library?

BTW: linking to Ares produces a notably smaller executable Cool
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat Nov 12, 2005 11:24 pm    Post subject: Reply with quote

About two weeks ago, I tried building Mango based on Ares. It wasn't working until I realized I had to remove the "include" switch from sc.ini that pointed to phobos. I also had to add the "version=Ares" to the command line and add the ares directory to the sc.ini file.

This only worked so far. When I tried to build the mango.d in the build directory (which imports almost the whole mango tree), the process failed in several files. Examining the errors revealed that, while some Mango files had been updated to include only Ares imports, others were still trying to access the phobos windows imports (despite version=Ares being active). I concluded that full support for an Ares-only Mango had not yet completed. I made a bunch of simple changes to Mango to import Ares windows definitions instead of phobos ones; this fixed the problem partially, but there were way to many files, and it seems mango wasn't designed to work completely with Ares.

I eventually settled on just trying Mango.io and Ares... With the few source fixes, this linked up beautifully and ran the io examples wonderfully.

My question: are there instructions for building Mango with Ares, or were we just supposed to figure it all out? Smile I may have missed something again!

Despite this I was very pleased with the results, Kris. I love Mango.io!

-JJR
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 1:56 am    Post subject: Reply with quote

Thx John;

Just remembered that Sean switched the paths for windows.d ~ I managed to compile OK since I still have the 'old' directory structure for Ares intact, all mixed up with some of the newer changes. No wonder the linker barfed.

What's stopping your build is that Sean switched from std.c.windows to sys.windows.c ~ Mango has not been updated to support that change, as you discovered. Otherwise, given the -version=Ares option, all of Mango would compile and link. I'll get that revised when I figure out a simple way to alias the old way to the new (any ideas on that?)

One example that fails to link is Servlets.d, as Sean has not yet included std.regexp in the Ares library. I can understand a reluctance to do that, so I might add it elsewhere in Mango instead?

Using Ares, the filecat.exe example comes out to 89KB ~ quite a bit less than when linking against Phobos. Glad you're finding mango.io useful Smile
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 2:51 am    Post subject: Reply with quote

To answer your question on building Mango upon Ares, specify -version=Ares, and use the -I and -X Build options: point the latter two at the appropriate Ares directory. That should work without having to tweak the sc.ini file.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Nov 13, 2005 3:18 am    Post subject: Reply with quote

Thanks Kris,

You identified both problems I had been experiencing. I had forgotten the exact details that helped me correct those errors. As you mention, one was the change in Ares directory paths for the windows defintions. I had fixed those problems in the mango files to work as expected with the new Ares windows paths ( not all of them, though ).

Once I progressed far enough, the second was indeed the lack of std.regex in Ares.

I think we really need std.regexp in Ares. It would be an excellent addition. How about it, Sean?

Thanks for the build tips, Kris.

About finding a way alias the old Ares windows paths to the new, I know of no simple solution. Can't you just scan and replace them? Or are you afraid Sean is going to change back to the other way again? Wink

-JJR
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 12:47 pm    Post subject: Reply with quote

JJR wrote:
About finding a way alias the old Ares windows paths to the new, I know of no simple solution. Can't you just scan and replace them? Or are you afraid Sean is going to change back to the other way again? Wink

Smile

It's more a case of not wanting to have yet another version-block in all those files that include either std.c.windows or std.c.linux. I'm hoping there's a means to alias those away via a common 'external libraries' module. Will have a go later today.

About regexp; I have a stripped down version that works with Ares, and adds group support too.
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 3:48 pm    Post subject: Reply with quote

Just checked-in a few changes to bring Mango back up on Ares, with one exception: I'm using a Build of Ares that includes a modified regexp. Other than that you should be good to go when using the following Build flags:
Code:
-version=Ares
-X[path to Ares source]
-I[path to Ares source]

The problem originally reported with windows.d turned out to be a reflection of the September change to Ares paths, combined with a non-virgin installation of Ares itself. There's now a mango.sys.OS module to take care of the various differences, though Mango has been compiled on Win32 only at this time ~ perhaps someone might try it out on linux?

If anyone needs the modified regexp module, I'll be happy to send it to you. It should be installed in the ares.std directory and added to the appropriate make file (alongside thread.d).
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sun Nov 13, 2005 4:39 pm    Post subject: Reply with quote

Moving std.c.windows broke a lot of stuff, including a bunch of dstress tests. I do prefer the new package layout--it provides a suitable place for D-based Windows modules, for example--but perhaps I should add forwarding modules in the old locations for compatibility?

As for std.regexp--it's just one more thing I haven't had the time to look at. How about I add it as a submission, which would put it in sub.std? Not ideal perhaps, but at least it would incorporate the module to the Ares distribution.
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 4:56 pm    Post subject: Reply with quote

Forwarding might help, though will always remain there as 'clutter'.

I can send you the modifed regexp.d if you like; the changes eliminate dependencies on a bunch of other phobos modules.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sun Nov 13, 2005 5:21 pm    Post subject: Reply with quote

Please do.
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Nov 13, 2005 5:58 pm    Post subject: Reply with quote

Done
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Mon Nov 14, 2005 2:43 pm    Post subject: Reply with quote

I've updated the latest release of Ares to include std.regexp in sub.std.regexp. You will also need to manually link against ares_sub.lib.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Ares All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group