473,486 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

compilation error while using extern C (HPUX aCC compiler)

1 New Member
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
0 2097

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

Similar topics

8
8872
by: wenmang | last post by:
Hi, We have the 3rd party libraries written in C. And, in every header file from 3rd party, it has the include guarde: #ifdef __cplusplus #define extern "C" { : APIs... : } #endif
10
3483
by: Rick Anderson | last post by:
All, I am receiving the following compilation error on LINUX (but not Solaris, HPUX, WIN32, etc): compiling osr.c LBFO.h(369): warning #64: declaration does not declare anything extern...
10
2330
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
6
2212
by: Joachim | last post by:
I made some project changes (which seems it doesn't help if I undo) which have created compilation error: " Server Error in '/PCSWebApp1' Application....
3
2904
by: manoj.pattanaik | last post by:
Hi, I am trying to compile following piece of code (bb.cpp) using aCC (HP ANSI C++ B3910B A.03.37) compiler on HP-UX 11.23. It gives error:485 //bb.cpp -- Starts #include <iostream> using...
14
1669
by: sunny | last post by:
We have three files a.c, b.c and main.c respectively as follows: a.c --- int a; b.c --- int a = 10; main.c ------ extern int a;
3
2229
by: subramanian100in | last post by:
Consider the following piece of code stored in a file called x.cpp class Test; extern void fn_one(Test t); extern Test fn_two(); Test fn_three(const Test &obj) { fn_one(obj);
2
1753
by: Rahul | last post by:
Hi, Everyone i get the following error when i compile and link both of the files, : undefined reference to `a' a.c #include <cstdio> const int a = 6;
2
6336
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.