LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 03-31-2010, 05:05 AM   #1
ash_bit2k2
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Error in compilation of cxx file with C++ compiler version as (CC: Sun C++ 5.9 SunOS_


Hi All

when I am compiling the cxx file on the system with compiler version (CC: Sun C++ 5.9 SunOS_sparc 2007/05/03) , I am facing the following error:-

/opt/SUNWspro/bin/CC -dy -misalign -xcode=abs64 -xarch=v9 -D__EXTENSIONS__ -Dsun4_R5=1 -I. -Isun4_R5_v -I/home/as185259/ash_iadraid/ash_get_10/IA/PORT/include -I/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v -I/app/oracle/product/10.2.0/client_1/sqllib/public -I/app/oracle/product/10.2.0/client_1/precomp/public -I/opt/informix/include -DSVR4 -O -g p -pta -c MContext.cxx -o sun4_R5_v/MContext.o || \
(rm -f sun4_R5_v.d; false)CC: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
"/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 97: Error: Only one of a set of overloaded functions can be extern "C".
"/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 99: Error: Only one of a set of overloaded functions can be extern "C".
"/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 101: Error: Only one of a set of overloaded functions can be extern "C".
"/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 102: Error: Only one of a set of overloaded functions can be extern "C".
4 Error(s) detected.



The same file with the same compilation command is getting compiled with compiler version CC: Sun WorkShop 6 update 2 C+ 5.3 2001/05/15 .
Can anyone suggest what should be the resolution:-

The code for the ssmalloc.h file is as under:-

#ifndef SSMALLOC_H
#define _SSMALLOC_H

#include <stddef.h>

#if defined(__sparcv9)
namespace ssmalloc {
#endif
#if defined(__cplusplus)
extern "C" {
#endif

/
The type for the malloc routine depends on
the compiler and library that you are using.
/
#if defined(hpux) || defined(sun4_R5) || defined(__GNUC_) || defined(_OS2_)
typedef void MALLOC_PTR;
#else
typedef char *MALLOC_PTR;
#endif

#if defined(_GNUG_)
typedef size_t MALLOC_SIZE;
#else
typedef unsigned MALLOC_SIZE;
#endif

#if defined(sun4) && ! defined(_GNUG_)
# define FREE_RETURNS int
# define FREE_RETURN return 0
#else
# define FREE_RETURNS void
# define FREE_RETURN return
#endif


//
//
// User-callable routines.
//
//
// Note: memalign and valloc are broken in that they do not aling
// memory on documented boundaries, and thus do not behave as described
// on the "malloc" manual page. They simply call malloc.
//
//
MALLOC_PTR malloc (MALLOC_SIZE size);
FREE_RETURNS free (MALLOC_PTR data);
MALLOC_PTR realloc (MALLOC_PTR data, MALLOC_SIZE size);
MALLOC_PTR calloc (size_t nelem, size_t elsz);
MALLOC_PTR valloc (unsigned size);
MALLOC_PTR memalign (unsigned alignment, unsigned size);

//
// This memory allocator supports memory allocation inside signal
// handlers. For correct operation, the following functions must be
// called upon entering and exiting signal handlers that allocate
// memory.
//

void ssmalloc_enter_signal_level();
void ssmalloc_exit_signal_level();

//
// Set this variable to not 0 (possibly in the debugger) if you want
// to get malloc to check memory data structures very carefully as it
// goes. This may be handy if you are trying to detect a memory
// trasher.
//
// It also causes ssmalloc to abort the program instead of returning
// zero if memory runs out.
//
extern int check_memory_very_carefully;

#if defined(__cplusplus)
}
#endif

#if defined(__sparcv9)
} // namespace ssmalloc {
#endif
#endif / _SSMALLOC_H */
 
Old 03-31-2010, 06:23 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,486

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Welcome to LQ !

Your ssmalloc.h file has 83 lines while the errors reported starts at line 97, please double check this is the right file.

Please use code tags to enclose code and similar samples.
 
Old 04-01-2010, 12:46 AM   #3
ash_bit2k2
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
The comments which were present at the start of the file have been removed , and the error messages are referring to the lines where these functions are declared:- malloc, realloc , valloc and memalign

Last edited by ash_bit2k2; 04-01-2010 at 12:48 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler error : /usr/lib/libc.so: file not recognized: File format not recognized kreena Solaris / OpenSolaris 7 12-14-2009 02:51 AM
Kernel compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 03:45 AM
Stubs-32.h file missing error during compilation on Windows using Colinux + FC4 rkaur Linux - Software 0 03-21-2007 06:11 AM
Kernel compilation error using cross compiler bond_7942 Linux - Software 0 02-02-2005 12:18 AM
C-Compiler for SUN - NEED HELP jmarsh Solaris / OpenSolaris 1 02-26-2003 08:34 PM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration