The Artima Developer Community
Sponsored Link

Java Answers Forum
Need help with JNI desperately

1 reply on 1 page. Most recent reply: Mar 24, 2003 1:42 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Peter

Posts: 1
Nickname: elessar
Registered: Mar, 2003

Need help with JNI desperately Posted: Mar 24, 2003 12:00 PM
Reply to this message Reply
Advertisement
I need to use some C++ code in a Java program. I used the tutorials at the Sun website. And for some reason if I compile the .cpp file with virtual c's command line compiler(also just like they specified) it says that it can't link libc.lib. This is the message I get in dos-prompt.

C:\Work\NativeThing>cl -Ic:\jdk1.3\include -Ic:\jdk1.3\include\win32 Help.cpp
-Fehelplib.dll -ML
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Help.cpp
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:helplib.dll
Help.obj
LINK : fatal error LNK1104: cannot open file "LIBC.lib"

Now I've been having this problem for a week now. And I can't fix it. And nobody I asks know' s either.

Can anybody help. I no that there is nothing wrong with my code. If you know of a good tutorial just post the link. It is worth a look.

thanks.


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Need help with JNI desperately Posted: Mar 24, 2003 1:42 PM
Reply to this message Reply
I forget the gory details of compiling DLLs on the command line with Microsoft's difficult-to-use-cryptic-error-message-spewing tools. I would either use Borland's compiler, or use the Microsoft Visual Studio to compile a DLL (use the option to create a blank DLL project and add your files -- don't forget to add the java include directories to your environment options). If you have a copy of Charles Petzold's Programming Windows 3.1 book, you can probably find the correct configuration to compile a DLL on the command line, also. Or you can spend the next couple centries trying to track down proverbial needle in the monstrous haystack of MSDN...

By the way, I don't think you want to be using the ML option, but you will need the LD option -- anyway, if you can avoid that rat's nest of complexity and use one of the options above, that is the preferred route (Borland C++ Builder is an awesome product and well worth the purchase price, in my opinion; in addition to having command line tools that actually work well, it is the best C++ IDE and RAD tool around).

Flat View: This topic has 1 reply on 1 page
Topic: Java text fields Previous Topic   Next Topic Topic: Please! urgent help needed with a grid!!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use