473,395 Members | 2,446 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,395 software developers and data experts.

c++ code not compiling in RH9

Hi

I wrote some code ages ago when I was not very hot on c++ but it
worked just fine. I had no problems compiling it on redhat 7.3 but
that box died recently so I tried compiling the code on my new RH 9
box and got the following error

In file included from /usr/include/c++/3.2.2/cstdlib:52,
from /usr/include/c++/3.2.2/bits/stl_algobase.h:67,
from /usr/include/c++/3.2.2/memory:54,
from /usr/include/c++/3.2.2/string:48,
from /usr/include/c++/3.2.2/bits/localefwd.h:49,
from /usr/include/c++/3.2.2/ios:48,
from /usr/include/c++/3.2.2/ostream:45,
from /usr/include/c++/3.2.2/iostream:45,
from lapackcmplx.h:8,
from tmatrix.cpp:2:
/usr/include/stdlib.h:742: parse error before `int'
In file included from /usr/include/c++/3.2.2/bits/stl_algobase.h:67,
from /usr/include/c++/3.2.2/memory:54,
from /usr/include/c++/3.2.2/string:48,
from /usr/include/c++/3.2.2/bits/localefwd.h:49,
from /usr/include/c++/3.2.2/ios:48,
from /usr/include/c++/3.2.2/ostream:45,
from /usr/include/c++/3.2.2/iostream:45,
from lapackcmplx.h:8,
from tmatrix.cpp:2:
/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

can anyone shed any light on this?

Thanks
Mike
Jul 19 '05 #1
4 1611
mike wrote:
/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

can anyone shed any light on this?

I think "abs" is not declared.

Jul 19 '05 #2
Gianni Mariani <gi*******@mariani.ws> wrote in message
/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

can anyone shed any light on this?

I think "abs" is not declared.


That much is clear - what I am wondering is why was it declared when I
compiled it under RH 7.3 but it is not under RH 9.
Jul 19 '05 #3
mi**********@yahoo.co.uk (mike) wrote in message news:<8c**************************@posting.google. com>...
Gianni Mariani <gi*******@mariani.ws> wrote in message
/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

can anyone shed any light on this?

I think "abs" is not declared.


That much is clear - what I am wondering is why was it declared when I
compiled it under RH 7.3 but it is not under RH 9.


So am I. But without seeing the code I would be guessing. I can get
the error Gianni singled out with this:

int main()
{
abs(42);
return 0;
}

But I suspect your problem is more complicated.

GJD
Jul 19 '05 #4
mike wrote:
Gianni Mariani <gi*******@mariani.ws> wrote in message
/usr/include/c++/3.2.2/cstdlib:90: `abs' not declared

can anyone shed any light on this?

I think "abs" is not declared.

That much is clear - what I am wondering is why was it declared when I
compiled it under RH 7.3 but it is not under RH 9.


My guess would be that RH 9 comes with a much more up to date version of
the compiler (7, IIRC, didn't even come with a "real" gcc - it was an
unofficial version that wasn't supposed to be released).

Chances are, if this version of gcc says there's an error it the code,
there's an error in the code, and the old version was wrong to accept it.

I suspect the problem may be that you are using abs() rather than
std::abs(), and you don't have an appropriate 'using' declaration.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #5

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

Similar topics

5
by: Jo Vermeulen | last post by:
Hello, I was wondering if Java supports a feature of C# (or .NET in general), namely compiling code at runtime. This is nice for scripting purposes. Users can script the application in real...
0
by: Johnathan Doe | last post by:
I've been thinking about what the issues would be in compiling Python into native machine code, and since type information is important in Python, it seems possible that Python code can be...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
64
by: Bayazee | last post by:
hi can we hide a python code ? if i want to write a commercial software can i hide my source code from users access ? we can conver it to pyc but this file can decompiled ... so ...!! do you...
3
by: RS | last post by:
Hi all, My code compiles well with gcc on linux and OS X, but now I have to run it at work, and my only choice is Visual Studio .Net 2003 environment on windows, which I had never used before....
1
by: Vijay Jain | last post by:
Hi All, We have a requirement to use icc compiler instead of existing gnu compiler. Though the icc compiler states that libraries compiled with gnu are compatible to use with icc. But we would...
21
by: onkar | last post by:
#include<stdio.h> int i; int i; int main(){ printf("i=%d\n",i); return 0; } Note : I am using gcc-3.4.3 on i386-redhat-linux
10
by: Tomás Ó hÉilidhe | last post by:
I'd post this on a gcc newsgroup but I'd be more productive talking to the wall. Anyway, let's say someone throws some source code at you for a particular program and says, "Just compile it, it...
0
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help compiling code dynamically it may involve some reflection so if any one is any good in that field or compiling code this would be a great time to show me what you know. by the way my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.