Article View: gnu.gcc.help
Article #42547Re: gcc for Windows 95/NT: compiling C++?
From: Christian Ghisler
Date: Thu, 23 Nov 1995 00:00
Date: Thu, 23 Nov 1995 00:00
59 lines
3188 bytes
3188 bytes
Hi!
karuottu@freenet.hut.fi (Kai Ruottu) wrote:
> The Cygnus headers are not C++ aware yet in the release 8. The Release 9
>seems to just came out, so check that first....
Thanks for letting me know! Which is the primary site for GCC for NT?
ftp://src.doc.ic.ac.uk/gnu/cygnus/sac still only has Beta 8.
In the meantime I translated all the OLE2 C++ stuff I need to use to
plain C and it finally works, even as a DLL. Some of the DLL tables
look a bit strange (if viewed with Win95 quick view), but the DLL is
detected by my program. I also wrote a little program and I had to
patch one byte in the header from value 3 to 2 to get a true Windows
GUI application. Otherwise a console is opened first and then the main
window of the program opens. Perhaps a compiler switch to choose
GUI/Console apps would be appropriate? Is there any documentation for
GCC/NT compiler switches? I now use the DJGPP docs.
When I tried to use the OLE2 functions which are essentially a table
of function pointers I had the problem that the called function
removed the function arguments from the stack and the calling function
also removed them, which of course gave a bad stack pointer. I tried
different prefixes like WINAPI with no success. I finally added a
asm("subl 12,esp");
command after each function to adjust the stack, and it finally
worked. Where can I find any documentation on the GNU C++ language?
I'm mainly a Pascal programmer and only need the C compiler to build
some DLLs with 32-bit OLE2 functions I cannot directly access from
Pascal. I only have a general C++ book which of course doesn't cover
the specialities of GNU C++. Originally I planned to buy MS visual C++
4.0 but it's still unavailable in Switzerland so I looked on the net
and found GNU C++. From the beta I think that it will be quite a good
compiler, and after some struggling I was able to build what I needed.
> It's easy to patch the headers for yourself by encapsulating the C-function
>protos with the normal :
> #ifdef __cplusplus
> extern "C" {
> #endif
Thanks, I will try that.
> There are many other things to patch, first and most important are just those
>still missing protos... we all know that we must have protos for all functions
>in C++ ....
Yes I also noticed that. I have an MSDN II subscription (primarily to
get Windows NT as a test platform) with all the SDKs so I took the
missing functions from there, but I suspect that the SDK is
copyrighted so I cannot simply send you the missing function
prototypes. If I remember correctly Borland has to pay MS royalties
for distributing these header files with their C++.
Regards
Christian Ghisler
Technical Details
Message-ID:
<491q3h$bnj@aragorn.unibe.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<48f6bv$kto@aragorn.unibe.ch> <karuottu.12.00274233@freenet.hut.fi>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,aff2148f3816d6f2 X-Google-Attributes: gid11318c,public From: ghisler@iap.unibe.ch (Christian Ghisler) Subject: Re: gcc for Windows 95/NT: compiling C++? Date: 1995/11/23 Message-ID: <491q3h$bnj@aragorn.unibe.ch> X-Deja-AN: 120031677 references: <48f6bv$kto@aragorn.unibe.ch> <karuottu.12.00274233@freenet.hut.fi> organization: University of Bern reply-to: ghisler@iap.unibe.ch newsgroups: gnu.gcc.help