|
Prev: Player-Ada 2.0.3.0 released
Next: GWindows
From: Bill on 31 Oct 2006 09:17 We have some code (about 60K lines) that was written for use on the Win95 platform as a collection of DLLs. We are now in the process of porting the parent application to Linux and would like to reuse the Ada code. The legacy code was written using the Aonix ObjectAda compiler/IDE and references packages like Win32 and Win32.Windef. We have been able to move the code over to the Linux side and compile using the GNU Ada compiler. However, to get this far we also had to copy the aforementioned "Win" packages over too. Clearly, this seems like the wrong thing to do, but it did get the compile to work. The problem is that we are receiving a fair number of linker errors that seem to point to the file winbase.h. So, it seems like there should be a Linux equivalent of Win32, but we have not been able find it. Can anyone point us to a replacement for these packages that will make the compiler AND the linker happy? Is there anything else we should know about in our effort to complete this port? Thanks in advance. Bill Lugg
From: Georg Bauhaus on 31 Oct 2006 09:30 On Tue, 2006-10-31 at 06:17 -0800, Bill wrote: > So, it seems like there should be a Linux equivalent of Win32, but we > have not been able find it. Can anyone point us to a replacement for > these packages that will make the compiler AND the linker happy? Is > there anything else we should know about in our effort to complete this > port? The Win32 library is Windows specific, a different operating system is going to use different system calls. However, in order to get things started, you could try the Wine libraries. They can be found here: http://www.winehq.com/
From: Howard on 31 Oct 2006 12:38 I work with Bill, and I wanted to provide a more detailed expansion of our situation; We are porting from a Windows-95 "legacy" system to a new Linux one. The code we are re-writing is Visual Basic, and we are translating it into C++. But, the VB code had a dependancy on a considerable amount of Ada 95 code that the VB code interfaced with via DLLs. We need to port this Ada code over, also. We have decided, given that there is between 45 and 55 thousand lines of Ada code, with its attendant complexity, to simply use the Ada code as is without re-writing it into C++. This Ada code depends on some files, also written in Ada, that then have some pragmas to a Visual C++ library, "winbase.h"... The Ada libs are; Win32 Win32-Utils Win32-Winbase (pragmas to VCPP winbase.h lib) Win32-Windef Win32-Winnt Stdarg Stdarg-Impl Stdarg-Inst Stdarg-Machine These are all Ada packages, and these name represent specs, and bodies, so named. So, we are going to have to compile the Ada code, then link it with the new C++ code. We are using the Gnu-G++ compiler linker, and we will need to be able to link in the Ada object files with our C++ files. We have to find a way to replace, or port, the mentioned Ada libs. The "Winbase" dependancy on the Visual C++ files is problematic, at best... So, again, any insight that can be provided would be greatly appreciated. You can write me directly at Howard.Parrish(a)cisf.af.mil
From: Martin Krischik on 31 Oct 2006 13:16 Howard wrote: > The Ada libs are; > > Win32 > Win32-Utils > Win32-Winbase (pragmas to VCPP winbase.h lib) > Win32-Windef > Win32-Winnt > > Stdarg > Stdarg-Impl > Stdarg-Inst > Stdarg-Machine They are not Ada libraries but Ada bindings. And the real problem you are going to have is to find a replacement for the Libraries those binding are binding to. i.E. For Win32* you will need a Linux replacement for "win32.dll". I like to point out that you would have the same problem if the code was written in C (so it would be unfair to say "damm you Ada") in which case you would look for a replacement of "windows.h" and it's friend. It's low level operating system access and it just isn't there in Linux. The bad news is: You need to replace it all with low level Linux access. Martin -- mailto://krischik(a)users.sourceforge.net Ada programming at: http://ada.krischik.com
From: Dr. Adrian Wrigley on 31 Oct 2006 15:21
On Tue, 31 Oct 2006 09:38:14 -0800, Howard wrote: > I work with Bill, and I wanted to provide a more detailed expansion of > our situation; > > We are porting from a Windows-95 "legacy" system to a new Linux one. > The code we are re-writing is Visual Basic, and we are translating it > into C++. But, the VB code had a dependancy on a considerable amount > of Ada 95 code that the VB code interfaced with via DLLs. > > We need to port this Ada code over, also. We have decided, given that > there is between 45 and 55 thousand lines of Ada code, with its > attendant complexity, to simply use the Ada code as is without > re-writing it into C++. This Ada code depends on some files, also > written in Ada, that then have some pragmas to a Visual C++ library, > "winbase.h"... Rather than trying to convert the VB into C++, keep the Ada, convert the Ada into Linux and glue the C++ to the Ada, why don't you convert the VB into Ada? You don't seem to have a strong technical reason to combine C++ and Ada, since C++ isn't a current implementation language. Because C++ and Ada have similar capabilities ("modern" compiled OO languages), the technical advantages of mixing them in new code are minimal. Mixing languages always has a cost - staff training, reduced compiler support, tricky interfaces, whatever. Since you plan to convert to C++, you must have good reasons. Political? Skills sets? Anyone well skilled in both C++ and Ada would keep it all in the same language (Ada), or have a really good justification already for mixing (interfacing to existing, complex C++ libraries without Ada bindings, perhaps). But since you haven't chosen the Linux libraries yet, this can't be why. I suspect you want to move to C++ for a mixture of political and skills reasons, but this really warrants planning to rewrite *all* the Ada, in due course. History suggests this is an unsound approach when existing code works broadly as needed. If politics is absent, do it all in Ada, getting necessary skills from outside. Just my thoughts. -- Adrian PS: If you email me the VB, Ada code, I'll rewrite it in Ada/Linux... for a small fee. |