- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: aCC Compiler error
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
Forums
Discussions
Discussions
Discussions
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
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
03-20-2007 12:50 AM
03-20-2007 12:50 AM
aCC Compiler error
I am porting tripwire product on HP-UX and when use aCC Compiler I am getting following error while compilation but compilation is successfull when i use g++ compiler(3.4.3 version)
error is:
aCC -DHAVE_CONFIG_H -I. -I. -I../.. -I.. -O -c -o file_unix.o file_unix.cpp
"../core/errorutil.h", line 140: warning #2340-D: value copied to temporary,
reference to temporary used
: eError( _T("") ),
^
"file_unix.cpp", line 170: error #2334: class "eFileOpen" has no suitable copy
constructor
throw( eFileOpen( sFileName, iFSServices::GetInstance()->GetErrS tring() ) ) ;
^
"file_unix.cpp", line 179: error #2334: class "eFileOpen" has no suitable copy
constructor
throw( eFileOpen( sFileName, iFSServices::GetInstance()- >GetErrString() ) );
^
"file_unix.cpp", line 236: error #2334: class "eInternal" has no suitable copy
constructor
throw( eInternal( _T("file_unix") ) );
^
"file_unix.cpp", line 257: error #2334: class "eFileSeek" has no suitable copy
constructor
throw eFileSeek();
^
"file_unix.cpp", line 281: error #2334: class "eFileRead" has no suitable copy
constructor
throw eFileRead( mpData->mFileName, iFSServices::GetInstance()-> GetErrString() ) ;
^
"file_unix.cpp", line 284: warning #2940-D: missing return statement at end of
non-void function "cFile::Read"
}
^
"file_unix.cpp", line 299: error #2334: class "eFileWrite" has no suitable
copy constructor
throw eFileWrite( mpData->mFileName, iFSServices::GetInstance()- >GetErrString() );
^
"file_unix.cpp", line 302: warning #2940-D: missing return statement at end of
non-void function "cFile::Write"
}
^
"file_unix.cpp", line 321: error #2334: class "eFileFlush" has no suitable
copy constructor
throw eFileFlush( mpData->mFileName, iFSServices::GetInstance()- >GetErrString() );
^
"file_unix.cpp", line 336: error #2334: class "eFileRewind" has no suitable
copy constructor
throw( eFileRewind( mpData->mFileName, iFSServices::GetInstance( )->GetErrString() ) );
^
"file_unix.cpp", line 369: error #2334: class "eFileTrunc" has no suitable
copy constructor
throw( eFileTrunc( mpData->mFileName, iFSServices::GetInstance() ->GetErrString() ) );
^
"file_unix.cpp", line 57: warning #2177-D: function "util_GetErrnoString" was
declared but never referenced
static TSTRING util_GetErrnoString()
^
9 errors detected in the compilation of "file_unix.cpp".
Please help me if any source code modifications has to be done or any compiler options to be provided ...
Suggesions are appreciated...
Thank you in Advance
--Regards
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 01:14 AM
03-20-2007 01:14 AM
Re: aCC Compiler error
To recommend source code modifications, someone might actually need to see the source code.
The compiler is telling you what lines to look at. Looks like a code review problem to me.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 03:49 PM
03-20-2007 03:49 PM
Re: aCC Compiler error
g++ is probably not as strict. When you throw, the copy constructor must exist and be accessible. Even if the copy ctor can be optimized out. Error 2330 occurs if not accessible.
To get error 2334 it requires that you have the wrong type of copy ctor, one without const&:
eFileOpen(eFileOpen&);
>Please help me if any source code modifications
Why would you not have const above? Did you want to modify the source? If you need to do that you need to make the field mutable or use a const_cast.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 09:06 PM
03-20-2007 09:06 PM
Re: aCC Compiler error
Thank you for your help...
I am bit confused Dennis ...I am herewith sending file_unix.cpp gile along with this mail...
Please help me in this regard(What needs to be added??? or modified????)
--Regards
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2007 09:14 PM
03-20-2007 09:14 PM
Re: aCC Compiler error
Typically .cpp files are useless, you don't see the headers. If you compile with -E -.i, you can produce a .i file. Of course you may not want to post it here if there is valuable IP or copyrighted info in it. (Ok, this is GNU GPL.)
>Please help me in this regard (What needs to be added??? or modified????)
I need the header that declares the copy ctor for eFileOpen. As I said, you probably have:
eFileOpen(eFileOpen&) and you should have
eFileOpen(const eFileOpen&)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:23 AM
03-21-2007 01:23 AM
Re: aCC Compiler error
I tried with that -E option and Generated the intemediate file also and got the constructors ...
I will am sending you the three .h files 1.file.h
Look at this line
(TSS_FILE_EXCEPTION(eFileOpen, eFile );)
2.fileerror.h
Look at this line
#define TSS_FILE_EXCEPTION( except, base ) \
TSS_BEGIN_EXCEPTION( except, base ) \
except( const TSTRING& filename, const TSTRING& msg, uint32 flags = 0 ) \
: base( filename, msg, flags ) {} \
TSS_END_EXCEPTION()
#endif
3.fsservices.h
look at this line
virtual TSTRING GetErrString() const = 0;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:24 AM
03-21-2007 01:24 AM
Re: aCC Compiler error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:25 AM
03-21-2007 01:25 AM
Re: aCC Compiler error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 01:28 AM
03-21-2007 01:28 AM
Re: aCC Compiler error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2007 04:20 PM
03-21-2007 04:20 PM
Re: aCC Compiler error
This shows the problem, a little different than I mentioned:
explicit eFileError(const eFileError& rhs)
: eError(rhs) { mFilename = rhs.mFilename; }
Using "explicit" here causes the copy ctor to be ignored. 12.3.1(2) says that this constructor can only be used where direct initialization is used.
8.5(12) says that throw is a copy-initialization, so that copy constructor isn't considered.
So remove "explicit".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2007 04:26 PM
03-24-2007 04:26 PM
Re: aCC Compiler error
Thank you for the reply and problem got resolved ...
I removed explicit keyword from the .h file and it is working fine ...
Thanks once again for your help ...
--Regards
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2007 03:02 PM
03-25-2007 03:02 PM
Re: aCC Compiler error
You have not awarded any points yet. Please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33