Incompatiblity of the code due to CC compiler version mismatch.


 
Thread Tools Search this Thread
Top Forums Programming Incompatiblity of the code due to CC compiler version mismatch.
# 22  
Old 02-12-2013
Yes, see 'man strlen' for your system and copy the includes.
# 23  
Old 02-12-2013
Quote:
Originally Posted by Revathi R
I am working on migration of code from 4.2 to 5.8
There are significant differences between 4.2 and 5.8 as far as C++ source code and C++ compilers are concerned. For starters you are going to have to provide prototypes for each function either through a header or in the source code itself.
# 24  
Old 02-13-2013
yes when i included string.h it is working fine..it just a sample code

but for my entire project to migrate, any helpful information plzz ,as i vent found even in migration guide to include additional libraries.

---------- Post updated at 12:12 AM ---------- Previous update was at 12:05 AM ----------

I am facing linking issues in the project i feel it is because of the standard libraries, i included standard libraies of SUN CC 5.8
actually code is written in SUN CC 4.3

will theire be any compilation option to resolve linking issues

any solution to this problem is highly appriciated

Thanks in advance,
Revathi
# 25  
Old 02-13-2013
Quote:
Originally Posted by Revathi R
Hello

I am migrating the code written in SUN 4.3 to SUN 5.8

while linking i am getting the following errors

Code:
Undefined                       first referenced
 symbol                             in file
cerr                                ../../../../libs/lib/libgeneral.a(string.o)
unsafe_ostream::operator<<(long)              ../../../../libs/lib/libgeneral.a(string.o)
operator delete(void*)                            msggen.o
operator new(unsigned int)                            licensemessage.o
Iostream_init::Iostream_init(void)               msggen.o
Iostream_init::~Iostream_init(void)               msggen.o
istream::operator>>(char*)                    ../../../../libs/lib/libgeneral.a(string.o)
setw(int)                          ../../../../libs/lib/libgeneral.a(string.o)
unsafe_ostream::outstr(const char*, const char*)     ../../../../libs/lib/libgeneral.a(string.o)
_ex_rethrow_q                       msggen.o
ld: fatal: Symbol referencing errors. No output written to msggen
*** Error code 1

I have written a sample program using the Prototypes for which it is firing out above error

#include<stdio.h>
#include<iostream.h>
int main()
{
int len=10;
char *coded = new char[len];
int *a=new int();
printf("Herllo");
cerr<<"Hello world:";
cerr << "\nString Array Out of Bounds!! index: " << ":elem"
<< " String length (0-"
<<" len" << ")\n";

delete [] coded;
delete a;
}

i could able to compile and run the program

so i am not getting any pointers to fix the issue. any pointer to fix the issue are highly appreciated.

Regards.
Revathi R
Assuming that this is the problem you're still seeing, have you recompiled everything with the new compiler?

It looks like the compiler can't find the C++ run-time libraries. Or it can't find the proper version...

There's probably a command-line option for the CC command to have it emit intermediate steps, so we can see what commands are actually getting run, especially the final link step.

Or, you can just run that CC link command under truss, and just truss the execve() calls:

Code:
truss -f -t\!all -texecve -vexecve -a -e -o /output/file/name CC ...

You can also post here, where you're likely to get help from someone who actually works for Oracle on the Studio compilers:

https://forums.oracle.com/forums/forum.jspa?forumID=896
# 26  
Old 02-13-2013
yes, i have compiled all the code with the 5.8 compiler
# 27  
Old 02-13-2013
Usually, good code uses #include and that provides any declaration or prototype, but if you wrote without prototypes, you have to add them to your includes, usually. I often put the calling code after the called code, so the prototype is the full subroutine, but if called externally, you need an include with a prototype (or hand made prototype copies all over the place, which is bad practice).
# 28  
Old 02-14-2013
for a header file like iostream.h, there will be some .so file right, so do i need to link that .so file, if include header in my code, do i have to include corresponding .so file, explicitly???


as i could see
Iostream_init::Iostream_init(void)
Iostream_init::~Iostream_init(void)

these two prototypes in iostream.h, while linking i am getting Symbol referencing errors as mentioned in the thread.

so is there any way i can trace the corresponding .so file for .h file
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need fix for rsync Error due to version mismatch

rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -t -a -x' /web/admin/Transfer/data/ user1@destserver1:/tmp/testf rsync version on sender server is:3.0.9 rsync version on sender server is:3.0.6 Linux sourceserver1 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. Linux

Linking issue due to so version number

Hi all, currently I'm facing a issue in linking a .so file. In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so. In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe. When I copy this test.exe to other... (4 Replies)
Discussion started by: vijkrr
4 Replies

3. AIX

Checking xlc compiler version

Hi, Below is output of lslpp command. bash-3.00# lslpp -L | grep xlC xlC.aix50.rte 11.1.0.1 C F XL C/C++ Runtime for AIX 5.3 xlC.cpp 9.0.0.0 C F C for AIX Preprocessor xlC.msg.en_US.cpp 9.0.0.0 C F C for AIX... (2 Replies)
Discussion started by: manoj.solaris
2 Replies

4. Programming

Choose compiler version

Hi, I'm new, here, and I'm searching for a simple solution for a simple problem. I'm working on RedHat 4.4.6-4 through a CentOS Virtual Machine and due to some reasons I must compile my C++ codes with these two different g++ versions: 4.4.6 and 4.2.2. The fact is that I should be able to... (4 Replies)
Discussion started by: Marcuss
4 Replies

5. Solaris

java version mismatch for normal user and root user

:confused: I installed latest version of java ( jre 1.6) on Solaris Machine ......when I run java -version as root, shows the latest version but when I run java -version as normal user, shows the old / previous version What should I do to fix this ...should show the latest version... (3 Replies)
Discussion started by: frintocf
3 Replies

6. AIX

install two different compiler version

Hi all. I have a simple question. There's a way to install under AIX system (5.3) two different compiler version, i.e. ibm xlf fortran 11 and 12? Seems that smitty doesn't allows user to change the default installation path; it only allows you to save the replaced files of the superseded... (1 Reply)
Discussion started by: poldo000
1 Replies

7. AIX

how to find out the compiler version and OS from binary file

Command to get the Compiler version(xlc/gcc) from the binary on AIX platform. I m searching for the Command, to get the Compiler(xlc/gcc) used to build the binary on AIX. I got two commands used on Linux Platform: - readelf -a <lib> | grep comment - hexdump -C -s 0x49e7b -n 1812 <lib> ... (1 Reply)
Discussion started by: Prajakta
1 Replies

8. UNIX for Dummies Questions & Answers

What version is the compiler?

Hi ! we have a intel fortran compiler on our computer. How do i find out what version it is ? Thank you, dsmv. (1 Reply)
Discussion started by: dsmv
1 Replies

9. Solaris

X Keyboard Extension version mismatch

I want to use calls from the X Keyboard Extension, but get "library version mismatch" error. First one is XkbLibraryVersion(..). This one already returns false. Then I call XkbOpenDisplay(...) which does not return a valid display; return value is XkbOD_NonXkbServer. If I open the display with... (0 Replies)
Discussion started by: hiker04
0 Replies

10. UNIX for Dummies Questions & Answers

gcc compiler version?

How do you determine which version of the GNU gcc compiler is on your system? (1 Reply)
Discussion started by: Ben070371
1 Replies
Login or Register to Ask a Question