Article View: comp.lang.java
Article #45Re: Borland/Native methods query...
From: Pete Becker
Date: Mon, 13 Nov 1995 18:01
Date: Mon, 13 Nov 1995 18:01
51 lines
2577 bytes
2577 bytes
In article <30A69CE9.3E40@mit.edu>, mesozoic@mit.edu says...
>
>Sean Doyle wrote:
>>
>> Sun's documentation for linking native methods
>> [http://java.sun.com/progGuide/native/stepbystep/_dynalib.html]
>> says that:
>>
>> "Note: You must have Microsoft Visual C++ Version 2.x to compile and
>> link DLLs (Dynamic Link Libraries). "
>>
>> I am new to the Windows world, but don't other compilers (such as
>> Borland's) compile DLLs as well? Or are there some dependencies on the
>> MFC that aren't apparent from a glance?
>>
>> Thanks
>> Sean Doyle
>Ok.. so I'm responding to my own original question with more questions.
>
>I'm trying to compile a simple C file to use in Java as a native method.
>
>It appears (although I am no expert) that Borland C++ 4.5 will *not* work for
Java native
>methods because there are compile errors in the standard java\include\win32
include files.
>Since I'm new to this enviroment {Borland, C++, and Windows95} I could
*easily* have made a
>simple error in setting environment variables. I'm trying to compile this as a
Win32 DLL.
>Apparently Borland is stricter than MVC++?
>
>In the "HelloWorld" native example from Sun, the first few compile errors are:
>
>Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 34:,expected
>Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 35:Multiple declaration for
'__int64'
>Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 79:'int64_t' cannot start a
parameter declaration
>Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 80:Declaration syntax error
>& etc...
>
>Sorry if I'm too clueless.. I know in the future that Sun & Borland are
planning to work
>together more closely :-)
What you've stumbled on is the nasty little secret that Microsoft's header
files for WIN32 won't compile with any other compiler, because they rely on
Microsoft's non-standard language extensions (better known as compiler bugs).
In general, you should use the WIN32 headers that come with the compiler you're
using, not the ones that come from Microsoft (unless, of course, you're using
Microsoft's compiler).
Technical Details
Message-ID:
<488161$k05@druid.borland.com>Path:
arc1-ca.pugleaf.net!druid.borland.com!usenetReferences:
<30A6891B.59C3@mit.edu> <30A69CE9.3E40@mit.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!druid.borland.com!usenet From: pete@borland.com (Pete Becker) Newsgroups: comp.lang.java,comp.lang.c++ Subject: Re: Borland/Native methods query... Date: 13 Nov 1995 18:01:37 GMT Organization: Borland International Message-ID: <488161$k05@druid.borland.com> References: <30A6891B.59C3@mit.edu> <30A69CE9.3E40@mit.edu> NNTP-Posting-Host: pbecker.borland.com Mime-Version: 1.0 Content-Type: Text/Plain; charset=ISO-8859-1 X-Newsreader: WinVN 0.99.5