473,670 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compilation error in "Hello World" program.

PG
Hi gurus,

I have AIX visual age C++ compiler version 5.0.2.3. I have a simple
hello world program that gives compilation errors. Any help will be
appreciated. Thanks

PG
***test.cpp****

#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>

int main()
{
cout << "Hello World" << endl;
return 0;
}
***end test.cpp****

****Errors:****
$ cc test.cpp
"/usr/vacpp/include/stdlib.h", line 123.13: 1540-0040 (S) The text
"llabs" is unexpected. "undef" may be undeclared or ambiguous.
****End of Errors:****
****Software Version****
lslpp -l | grep vacpp

vacpp.Dt.common 5.0.2.0 COMMITTED VisualAge C++ Desktop
vacpp.Dt.ide 5.0.2.0 COMMITTED VisualAge C++ IDE
Desktop
vacpp.Dt.techid e 5.0.2.0 COMMITTED VisualAge C++ IDE
Tech Preview
vacpp.cmp.C 5.0.2.0 COMMITTED VisualAge C++ C
Compiler
vacpp.cmp.aix50 .lib 5.0.2.4 COMMITTED VisualAge C++
Libraries for
vacpp.cmp.batch 5.0.2.4 COMMITTED VisualAge C++ Batch
Compiler
vacpp.cmp.core 5.0.2.3 COMMITTED VisualAge C++
Compiler
vacpp.cmp.exten sion 5.0.2.3 COMMITTED VisualAge C++
Extension
vacpp.cmp.inclu de 5.0.2.4 COMMITTED VisualAge C++
Compiler Include
vacpp.cmp.incre mental 5.0.2.3 COMMITTED VisualAge C++
Incremental
vacpp.cmp.lib 5.0.2.4 COMMITTED VisualAge C++
Libraries
vacpp.cmp.rte 5.0.2.0 COMMITTED VisualAge C++
Compiler
vacpp.cmp.tools 5.0.2.4 COMMITTED VisualAge C++ Tools
vacpp.html.EN_U S 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.SBCS 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.comm on 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.en_U S 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.help 5.0.2.0 COMMITTED VisualAge C++ HTML
Help Engine
vacpp.ide 5.0.2.3 COMMITTED VisualAge C++ IDE
vacpp.ioc.aix50 .rte 5.0.2.1 COMMITTED IBM Open Class
Library AIX 5.0
vacpp.ioc.rte 5.0.2.1 COMMITTED IBM Open Class
Library
vacpp.lic 5.0.2.0 COMMITTED VisualAge C++ Licence
Files
vacpp.loc.en_US .cmp.core 5.0.2.3 COMMITTED VisualAge Compiler
C++ Locale
vacpp.msg.en_US .cmp.batch 5.0.2.0 COMMITTED VisualAge Batch
Compiler C++
vacpp.msg.en_US .cmp.core 5.0.2.3 COMMITTED VisualAge Compiler
C++
vacpp.msg.en_US .cmp.tools 5.0.2.0 COMMITTED VisualAge C++ Tools
vacpp.msg.en_US .html.help 5.0.2.0 COMMITTED VisualAge C++ Help
Engine
vacpp.msg.en_US .ide 5.0.2.3 COMMITTED VisualAge C++ IDE
vacpp.msg.en_US .ioc.rte 5.0.2.1 COMMITTED IBM Open Class
Library Runtime
vacpp.msg.en_US .rescmp 5.0.2.0 COMMITTED VisualAge C++
Resource
vacpp.rescmp 5.0.2.0 COMMITTED VisualAge C++
Resource
vacpp.Dt.common 5.0.2.0 COMMITTED VisualAge C++ Desktop
vacpp.Dt.ide 5.0.2.0 COMMITTED VisualAge C++ IDE
Desktop
vacpp.Dt.techid e 5.0.2.0 COMMITTED VisualAge C++ IDE
Tech Preview
vacpp.cmp.core 5.0.2.3 COMMITTED VisualAge C++
Compiler
vacpp.html.EN_U S 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.SBCS 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.comm on 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.en_U S 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.help 5.0.2.0 COMMITTED VisualAge C++ HTML
Help Engine
vacpp.loc.en_US .cmp.core 5.0.2.3 COMMITTED VisualAge Compiler
C++ Locale
****End of Software Version****
Jul 22 '05 #1
9 6656

"PG" <pg******@yahoo .com> wrote in message
news:12******** *************** **@posting.goog le.com...
Hi gurus,

I have AIX visual age C++ compiler version 5.0.2.3. I have a simple
hello world program that gives compilation errors. Any help will be
appreciated. Thanks

PG
***test.cpp****

#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
Non standard header file.

int main()
{
cout << "Hello World" << endl;
return 0;
}
***end test.cpp****

****Errors:****
$ cc test.cpp
"/usr/vacpp/include/stdlib.h", line 123.13: 1540-0040 (S) The text
"llabs" is unexpected. "undef" may be undeclared or ambiguous.
****End of Errors:****


If a compiler can't compile its own header files that would indicate to me
that it is wrongly installed. Obviously that is beyond the scope of this
group.

However you might like to try the following legal C++ program (yours was not
legal) to see if you get any further.

#include <iostream>

int main()
{
std::cout << "hello, world\n";
}

Note the name of the header file <iostream>, <iostream.h> is not a standard
C++ header file. Also note the use of std::cout rather than cout.

I don't think either of these corrections explain the error message above
however.

john

Jul 22 '05 #2
PG wrote:
#include <stdio.h>
#include <stdlib.h>
You don't need those.
#include <iostream.h>

int main()
{
cout << "Hello World" << endl;
return 0;
}


Jul 22 '05 #3

"Bill Seurer" <se****@us.ibm. com> wrote in message
news:c7******** ***@news.rchlan d.ibm.com...
PG wrote:
#include <stdio.h>
#include <stdlib.h>


You don't need those.


Well no, but's it not incorrect to have them.
#include <iostream.h>


Unlike the above header.

john
Jul 22 '05 #4

A couple of things

1) do a 'which cc' and make sure you're pointing to /usr/vacpp/bin
and not /usr/vac/bin. If you're pointing to 'vac' then modify
your PATH to add /usr/vacpp/bin to the front of it.

2) use xlC instead of cc

3) Don't call the program 'test' ... there's a Unix command of the
same name and if you don't have '.' in your PATH, you're going
to be even more confused when you get it compiled =8-)

Cheers

Jeff Herrick

ps...Notwithsta nding the other remarks re your header files, your
example compiles and links okay on my 5.1 box when I follow
the steps above

On 7 May 2004, PG wrote:
Hi gurus,

[snip]


Jul 22 '05 #5
joe
pg******@yahoo. com (PG) writes:
I have AIX visual age C++ compiler version 5.0.2.3. I have a simple
hello world program that gives compilation errors. Any help will be
appreciated. Thanks

PG
***test.cpp****

#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>

int main()
{
cout << "Hello World" << endl;
return 0;
}
***end test.cpp****

****Errors:****
$ cc test.cpp
"/usr/vacpp/include/stdlib.h", line 123.13: 1540-0040 (S) The text
"llabs" is unexpected. "undef" may be undeclared or ambiguous.
****End of Errors:****


Are you sure 'cc' is a C++ compiler? On the AIX box I have access to
the C++ compiler is called xlC, and cc is a C compiler.

Joe
--
"Surprise me"
- Yogi Berra when asked where he wanted to be buried.
Jul 22 '05 #6
jo*@invalid.add ress wrote:
Are you sure 'cc' is a C++ compiler? On the AIX box I have access to
the C++ compiler is called xlC, and cc is a C compiler.


Good point, plus the fact that the V5 compiler is out of service,
and their install is woefully back-level (you can still get the
5.0.2.9 update from the service website).

--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
_______________ _______________ _______________ _______________ ____________
Jul 22 '05 #7
Gary R. Hook wrote:
jo*@invalid.add ress wrote:
Are you sure 'cc' is a C++ compiler? On the AIX box I have access to
the C++ compiler is called xlC, and cc is a C compiler.

Good point, plus the fact that the V5 compiler is out of service,
and their install is woefully back-level (you can still get the
5.0.2.9 update from the service website).

????
cc merely invokes xlC with certain default options. xlC is the C
compiler you need vacpp or some such to do c++, no?

Jul 22 '05 #8
joe
"Timothy J. Bogart" <tb*****@frii.n et> writes:
Gary R. Hook wrote:
jo*@invalid.add ress wrote:
Are you sure 'cc' is a C++ compiler? On the AIX box I have access to
the C++ compiler is called xlC, and cc is a C compiler.

Good point, plus the fact that the V5 compiler is out of service,
and their install is woefully back-level (you can still get the
5.0.2.9 update from the service website).

????
cc merely invokes xlC with certain default options. xlC is the C
compiler you need vacpp or some such to do c++, no?


Well, on our machines, xlc invokes the C compiler with configured
options. xlC invokes the C++ compiler with configured options. I'm not
sure how 'cc' fits into this scheme, hence my question.

Joe
--
"Surprise me"
- Yogi Berra when asked where he wanted to be buried.
Jul 22 '05 #9
pg******@yahoo. com (PG) wrote in message news:<12******* *************** ***@posting.goo gle.com>...
Hi gurus,

I have AIX visual age C++ compiler version 5.0.2.3. I have a simple
hello world program that gives compilation errors. Any help will be
appreciated. Thanks

PG
***test.cpp****

#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>

int main()
{
cout << "Hello World" << endl;
return 0;
}
***end test.cpp****

****Errors:****
$ cc test.cpp
"/usr/vacpp/include/stdlib.h", line 123.13: 1540-0040 (S) The text
"llabs" is unexpected. "undef" may be undeclared or ambiguous.
****End of Errors:****


This seems to be a known issue, see APAR IY23677 (TEXT "LLABS"
UNEXPECTED COMPILING STDLIB.H).

Cheers,
z
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2182
by: hou | last post by:
Hello everyone, I am new to PHP. I wrote a simple "Hello World" program, but I got a warning as following Warning: Failed opening '/home/ma/b/dhou/public_html/index.php' for inclusion (include _path='.:/usr/local/lib/php') in Unknown on line 0. It was my mistake that I didn't open the permission 644 for my index.php. But what I don't understand is the error message,
3
4422
by: penguinman | last post by:
Its just a hello world program. Compile and build goes with no warning or error. i type ./a.out and the shell just sits there. It doesnt hang but it just sits there with no output. I executed the program in ddd, execution window opened up and I got a blank. I executed the program using Anjuta same thing. In all cases the program had no errors or warning. But there is no
6
4123
by: Matthew | last post by:
How would I go about creating a simple "hello world" program that will run in Unix. I am using MS Visual C++.
21
4103
by: Alf P. Steinbach | last post by:
Just because there seems to be a lack of post-standard _correct_ tutorials: <url: http://home.no.net/dubjai/win32cpptut/>. Disclaimer: written this evening so perhaps there are "bugs" in the presentation -- are there? Plea: if someone takes the time to convert the word document to clean xhtml perhaps with stylish clear readable layout, then it will be an incentive for me to go on to write a next part, and a next part...
33
5560
by: ankursinha | last post by:
Hi, Is it possible to write a C program that prints "Hello World" on screen without having a single semi-colon in the entire program? The extra constraint here is that u r not allowed to use if,while,switch etc. So far,i figured this could be done by insertint the printf statement in main as shown: int main(int argc=printf("Hello world")
42
9873
by: Prashanth Badabagni | last post by:
Hi, Can any body tell me how to print "hello,world" with out using semicolon Thanks in advance .. Bye Prashanth Badabagni
8
7576
by: vijay | last post by:
Hello, As the subject suggests, I need to print the string in the reverse order. I made the following program: # include<stdio.h> struct llnode { char *info;
4
6282
by: arnuld | last post by:
i am learning C and doing the exercise 1-1 of K&R2, where K&R ask to remove some parts of programme and experiment with error, so here i go: #include <stdio.h> int main () { printf('hello world\n'); }
3
2813
by: amanjsingh | last post by:
I want to know what is the origin of Hello World program and who wrote it, what language it was written in and why was Hello World chosen as a phrase? Thanks a lot AJ
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8815
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8592
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6216
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4213
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4393
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2802
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 we have to send another system

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.