473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.techide 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.extension 5.0.2.3 COMMITTED VisualAge C++
Extension
vacpp.cmp.include 5.0.2.4 COMMITTED VisualAge C++
Compiler Include
vacpp.cmp.incremental 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_US 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.SBCS 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.common 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.en_US 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.techide 5.0.2.0 COMMITTED VisualAge C++ IDE
Tech Preview
vacpp.cmp.core 5.0.2.3 COMMITTED VisualAge C++
Compiler
vacpp.html.EN_US 5.0.0.0 COMMITTED VisualAge C++
Documentation
vacpp.html.SBCS 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.common 5.0.2.0 COMMITTED VisualAge C++
Documentation
vacpp.html.en_US 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 6635

"PG" <pg******@yahoo.com> wrote in message
news:12*************************@posting.google.co m...
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.rchland.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...Notwithstanding 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.address 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.address 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.net> writes:
Gary R. Hook wrote:
jo*@invalid.address 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.google.c om>...
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
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...
3
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...
6
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
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...
33
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...
42
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
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
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...
3
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
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.