By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,421 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,421 IT Pros & Developers. It's quick & easy.

compilation error while using extern C (HPUX aCC compiler)

P: 1
Hi all,

I am trying to compile some code on HP-UX-Itanium faluire.
using aCC: HP C/aC++ B3910B A.06.12 [Aug 17 2006]

I have written a sample code below and using the following compilation
command.

*aCC -c -o test.o -AP -Ae -DHPUX test.cpp*

#if defined (SOLARIS) || defined (HPUX) || defined (__cplusplus)
extern "C" {
#endif
int len;
#if defined (SOLARIS) || defined (HPUX) || defined (__cplusplus)
}
#endif

int main()
{
int abc()
{
return 1;
}
}

Following is the error I am getting:

"test.cpp", line 2: error #2040: expected an identifier
extern "C" {
^

"test.cpp", line 2: error #2065: expected a ";"
extern "C" {
^

At end of source: warning #2012-D: parsing restarts here after previous
syntax
error

2 errors detected in the compilation of "test.cpp".

*Could any one please let me know what could be the reason for the error?*

Thanks
Alok Verma
Feb 27 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.