- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Problem creating Shared image in C++
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 02:19 AM
тАО12-14-2004 02:19 AM
I am trying to use JNI to call C++ code and it runs fine.But it gives many UNDEFINED SYMBOLS and UNDEFINED SYMBOL REFERENCES errors while linking the shared image.
I tried creating the.opt file after making changes in the Batch file available with the
JNI_EXAMPLES.BCK which is available from the Java website but still it is giving the same linking errors.
Inspite of the linking warnings the image file is created but whn i try to load it from java application it is giving an error "ident mismatch with shareable image"
can anyone help me in telling where m i going wrong ?
Programming Platform:
OpenVMS 7.3-1
Compaq C++ V6.3-020
java version 1.4.2
Regards
Malav
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 06:36 AM
тАО12-14-2004 06:36 AM
Re: Problem creating Shared image in C++
I have not a system with java and c++ handy, so I cant do any testing. Any way (from common VMS linking problems)you should first get rid of UNDEFINED SYMBOLS errors. These errors are most times because you forgot to link an object or shareable image into yours image. Can you give us a listing of these errors?
The "ident mismatch with shareable image" error is when the program is linked with a newest shareable image and then run with an older version of that image. Maybe you have more than one Java version on the machine?
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 06:44 AM
тАО12-14-2004 06:44 AM
Re: Problem creating Shared image in C++
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 07:46 AM
тАО12-14-2004 07:46 AM
Re: Problem creating Shared image in C++
Could you please post some sample messages. If the names are strange, you may have a "mangling" issue. External names for shareable images need to be unmangled.
Start with a very simple case. Just a C++ shareable image with one routine that does something like print "Hello World". Try calling that from java.
If you can't get that working, post your source code and commands here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 02:19 PM
тАО12-14-2004 02:19 PM
Re: Problem creating Shared image in C++
Hi,
Be sure to check out the following topic in this conference:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061
Hope that helps,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2004 03:43 PM
тАО12-14-2004 03:43 PM
Re: Problem creating Shared image in C++
Thanks for ur replies. But still the problem persists.
I'll just answer all the previous posts first.
Bojan : I m using a .com file provided with JNI_EXAMPLES.BCK to create the .opt file. Also i tried manually creating the .opt file by editing the " CXX$DEMANGLER_DB. " as suggested in one of the other posts on the forum. But still the problem of Undefined Symbol remains.
Regarding Java. I have only one version installed.
Ian Miller: Yes i have included /PREFIX=ALL option while compiling.
John Gillings : I have created a sample Program and it is working fine. But in actual case there are lot many function and many more c++ files for creating the Image.
Hein: I have used the mentioned URL for creating the Shared Image.
***********************************
Following is the .Com file i use for compiling and creating the .opt file. it has reference to scan_globals_for_option.com which is the .com file provided with the JNI_EXAMPLE. and it works fine with the sample program.
************************************
$ opts = "/prefix=all /float=ieee /ieee=denorm/define=JIT_OPTION " + -
"/nowarnings /names=(short,as_is) /reentrancy=multithread /define=__US
$ cxx 'opts' 'INCL' abc.cpp
$ cxx 'opts' 'INCL' def.cpp
$ cxx 'opts' 'INCL' xyz.cpp
$ cxx 'opts' 'INCL' mno.cpp
$ GLB_OPT:= global_symbol_option
$ LIB_OPT:= library_option
$ @scan_globals_for_option *.obj 'GLB_OPT'.opt
$ OPEN/WRITE library_opt_file 'LIB_OPT'.opt
$ write library_opt_file "GSMATCH=LEQUAL,1,1"
$ write library_opt_file "abc.obj"
$ write library_opt_file "def.obj"
$ write library_opt_file "xyz.obj"
$ write library_opt_file "mno.obj"
$ write library_opt_file "SYS$SHARE:JAVA$JAVA_SHR/SHARE"
$ close library_opt_file
$ DEBUG_SWITCH := /nodebug/notrace
$ IMAGE_NAME := SharedImage
$ cxxlink 'DEBUG_SWITCH'/SHARE='IMAGE_NAME'.exe -
'LIB_OPT /OPT,'GLB_OPT /opt
*******************************************
Some of the Errors:
**************************************
%LINK-W-NUDFSYMS, 85 undefined symbols:
%LINK-I-UDFSYM, JavaLogger::JavaLogger(JNIEnv_ *, _jobject *)
%LINK-I-UDFSYM, bool JavaLogger::log(const std::basic_string
%LINK-I-UDFSYM, JavaLogger::~JavaLogger()
****************************************
Regards
Malav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2004 04:05 AM
тАО12-15-2004 04:05 AM
Re: Problem creating Shared image in C++
You probably have more than one version of Java installed whether you know it or not. I think VMS 7.3-1 shipped with 1.1.8 or something like that, so when you installed 1.4.2 you then had two versions. Double check that you are running JAVA$SETUP.COM appropriately to get the version you want.
There are a *lot* of Java-related shareable images in SYS$SHARE. It could well be that a simple example works fine linked against nothing but JAVA$JAVA_SHR.EXE, but for your real code you may need to link against one or more other images. For example, to find which image has the JavaLogger symbol, try this:
$ search/format=nonulls sys$share:java*.exe javalogger
If you find it in an image you are not currently linking against, then add another line to your options file to include that image.
And now that I think of it, you probably want to check the logical name JAVA$JAVA_SHR and see where it's pointing. Most likely you should change your options file to simply say
JAVA$JAVA_SHR/SHARE
instead of
SYS$SHARE:JAVA$JAVA_SHR.EXE/SHARE
The latter links against a hard-coded path and very likely gives you the version of the library from system installation time rather than the latest Java upgrade. Using the logical name should give you whatever is current, plus your code should still work without relinking after a Java upgrade.
This is all somewhat speculative since I have not built any JNI applications, but just working from first principles of how shareable images are typically referenced on VMS, I think you are probably getting the wrong version of the main image or missing an auxiliary image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2004 05:45 AM
тАО12-16-2004 05:45 AM
Solution$ pipe anal/image sys$share:java$java_shr.exe | search sys$input "file ident"
image file identification: "V 1.1.8-1"
$ pipe anal/image java$java_shr | search sys$input "file ident"
image file identification: "JAVA 1.4.2-2"
$ show logical java$java_shr
"JAVA$JAVA_SHR" = "SYS$COMMON:[JAVA$142.JRE.LIB.ALPHA]JAVA$JAVA_SHR.EXE;" (LNM$PROCESS_TABLE)
So do change your .COM file as indicated in my previous post. There may be other problems but this is definitely at least part of your trouble and is causing the ident mismatch error and very likely the unresolved symbols as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2004 02:48 PM
тАО12-16-2004 02:48 PM
Re: Problem creating Shared image in C++
I made the change in the com file and yes the "ident mismatch error" is solved.
Thank You again for ur help.
-Malav