Re: Calling a matlab dll in java
- From: "Daniel Mark" <d@xxxxxxxxxxx>
- Date: Sun, 19 Mar 2006 14:17:47 -0500
Dear Wojceich:
I have followed all your instruction above and got one more problem
as follows.
If I use the following compile parameters
C:\temp\CallingAMatlabDLLInJava>cl -I"C:\Program
Files\Java\jdk1.5.0_06\include" -I"C:\Program
Files\Java\jdk1.5.0_06\include\win32" -I"C:\Program
Files\MATLAB704\extern\include" -I"C:\Program
Files\MATLAB704\extern\lib\win32\microsoft\msvc60" -I"C:\
Program Files\Microsoft Visual Studio\VC98\MFC\SRC" -LD
JNITest_JNITest.cpp -Felibjnitest.dll
I got some warning from compiler as follows:
C:\Program Files\Microsoft Visual Studio\VC98\include\istream(547) :
warning C4530: C++ exception handler used, but unwind se
mantics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual Studio\VC98\include\ostream(234) :
warning C4530: C++ exception handler used, but unwind se
mantics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual
Studio\VC98\include\ostream(229) : while compiling class-template
member function '
class std::basic_ostream<char,struct std::char_traits<char>
&__thiscall std::basic_ostream<char,structstd::char_traits<cha
r> >::put(char)'
C:\Program Files\Microsoft Visual Studio\VC98\include\ostream(234) :
warning C4530: C++ exception handler used, but unwind se
mantics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual
Studio\VC98\include\ostream(229) : while compiling class-template
member function '
class std::basic_ostream<unsigned short,struct
std::char_traits<unsigned short> > &__thiscall
std::basic_ostream<unsigned sho
rt,struct std::char_traits<unsigned short> >::put(unsigned
short)'
C:\Program Files\Microsoft Visual Studio\VC98\include\istream(46) :
warning C4530: C++ exception handler used, but unwind sem
antics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual
Studio\VC98\include\istream(41) : while compiling class-template
member function 'b
ool __thiscall std::basic_istream<char,struct
std::char_traits<char> >::ipfx(bool)'
C:\Program Files\Microsoft Visual Studio\VC98\include\istream(46) :
warning C4530: C++ exception handler used, but unwind sem
antics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual
Studio\VC98\include\istream(41) : while compiling class-template
member function 'b
ool __thiscall std::basic_istream<unsigned short,struct
std::char_traits<unsigned short> >::ipfx(bool)'
C:\Program Files\Microsoft Visual Studio\VC98\include\xstring(525) :
warning C4530: C++ exception handler used, but unwind se
mantics are not enabled. Specify -GX
C:\Program Files\Microsoft Visual
Studio\VC98\include\xstring(521) : while compiling class-template
member function '
void __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char>
::_Copy(unsigned int)'C:\Program Files\Microsoft Visual Studio\VC98\include\ostream(296) :
warning C4530: C++ exception handler used, but unwind se
mantics are not enabled. Specify -GX
C:\Program Files\MATLAB704\extern\include\mclmcr.h(698) : see
reference to function template instantiation 'class std
::basic_ostream<char,struct std::char_traits<char> >
&__cdecl std::operator <<(class
std::basic_ostream<char,struct std::char
_traits<char> > &,const char *)' being compiled
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/dll
/implib:libjnitest.lib
/out:libjnitest.dll
JNITest_JNITest.obj
Creating library libjnitest.lib and object libjnitest.exp
Then I add the GX switch and get the following from screen:
C:\temp\CallingAMatlabDLLInJava2>cl -I"C:\Program
Files\Java\jdk1.5.0_06\include" -I"C:\Program
Files\Java\jdk1.5.0_06\includ
e\win32" -I"C:\Program Files\MATLAB704\extern\include" -I"C:\Program
Files\MATLAB704\extern\lib\win32\microsoft\msvc60" -I"C:
\Program Files\Microsoft Visual Studio\VC98\MFC\SRC" -LD
JNITest_JNITest.cpp -GX -Felibjnitest.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
JNITest_JNITest.cpp
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/dll
/implib:libjnitest.lib
/out:libjnitest.dll
JNITest_JNITest.obj
Creating library libjnitest.lib and object libjnitest.exp
The real problem comes from here:)
If I run the java main program, I got some errors as follows:
C:\temp\CallingAMatlabDLLInJava2>java JNITest
hello START
Exception in thread "main" java.lang.UnsatisfiedLinkError:
initializeApplication
at JNITest.initializeApplication(Native Method)
at JNITest.main(JNITest.java:33)
So what should I do?
Thank you so much for your great helps:)
-Daniel
.
- Follow-Ups:
- Re: Calling a matlab dll in java
- From: wgradkowski
- Re: Calling a matlab dll in java
- References:
- Calling a matlab dll in java
- From: Mangesh
- Re: Calling a matlab dll in java
- From: Mangesh
- Re: Calling a matlab dll in java
- From: wgradkowski
- Re: Calling a matlab dll in java
- From: daniel
- Re: Calling a matlab dll in java
- From: wgradkowski
- Calling a matlab dll in java
- Prev by Date: plotyy and xlim
- Next by Date: neural net classification problem
- Previous by thread: Re: Calling a matlab dll in java
- Next by thread: Re: Calling a matlab dll in java
- Index(es):
Relevant Pages
|