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

Is this a problem with my compiler

Hi

I'm wondering if this is a problem with my (g++) compiler or with the
code.

I have to modify some code to make g++ compile,
else I get a no matching function error.
The commented out line were the original code,

//double ScaleX =
vtProjection::GeodesicDistance(DPoint2(left,bottom ),DPoint2(right,bottom));
DPoint2 xxxx(left,bottom),yyyy(left,bottom);
double ScaleX = vtProjection::GeodesicDistance(xxxx,yyyy);

Here is the function prototype:
static double GeodesicDistance (const DPoint2 &in, DPoint2 &out, bool
bQuick=false)

BTW, I didn't write this code, I just run into this problem, while
compiling a package.
I like to know if this is a problem with my g++ compiler, or with the
code.
after that I can decide which group to report this bug.

I have a hunch the same code compiles under vc++

Thanks for your time.

Sep 11 '06 #1
3 1806
<pe*****@yahoo.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi

I'm wondering if this is a problem with my (g++) compiler or with the
code.

I have to modify some code to make g++ compile,
else I get a no matching function error.
The commented out line were the original code,

//double ScaleX =
vtProjection::GeodesicDistance(DPoint2(left,bottom ),DPoint2(right,bottom));
DPoint2 xxxx(left,bottom),yyyy(left,bottom);
double ScaleX = vtProjection::GeodesicDistance(xxxx,yyyy);

Here is the function prototype:
static double GeodesicDistance (const DPoint2 &in, DPoint2 &out, bool
bQuick=false)

BTW, I didn't write this code, I just run into this problem, while
compiling a package.
I like to know if this is a problem with my g++ compiler, or with the
code.
after that I can decide which group to report this bug.

I have a hunch the same code compiles under vc++

Thanks for your time.
You didn't state what errors you were getting. I do notice, however, that
you are trying to pass a temporary as a reference. I know that I am doing
something similar in one of my programs, and I get a warning that it is a
microsoft extention.
Sep 11 '06 #2

pe*****@yahoo.com 写道:
Hi

I'm wondering if this is a problem with my (g++) compiler or with the
code.

I have to modify some code to make g++ compile,
else I get a no matching function error.
The commented out line were the original code,

//double ScaleX =
vtProjection::GeodesicDistance(DPoint2(left,bottom ),DPoint2(right,bottom));
DPoint2 xxxx(left,bottom),yyyy(left,bottom);
double ScaleX = vtProjection::GeodesicDistance(xxxx,yyyy);

Here is the function prototype:
static double GeodesicDistance (const DPoint2 &in, DPoint2 &out, bool
bQuick=false)

BTW, I didn't write this code, I just run into this problem, while
compiling a package.
I like to know if this is a problem with my g++ compiler, or with the
code.
after that I can decide which group to report this bug.

I have a hunch the same code compiles under vc++

Thanks for your time.
the reason is in your function prototype, the second argument is a
reference
of DPoint2. And in your original call, you tried to pass in the
reference of a temporary
variable, which is not allowed. Since the temporary will be destroyed
after the sentence.

Sep 11 '06 #3
pe*****@yahoo.com schrieb:
I'm wondering if this is a problem with my (g++) compiler or with the
code.
With the code, I believe.
//double ScaleX =
vtProjection::GeodesicDistance(DPoint2(left,bottom ),DPoint2(right,bottom));
DPoint2 xxxx(left,bottom),yyyy(left,bottom);
double ScaleX = vtProjection::GeodesicDistance(xxxx,yyyy);

Here is the function prototype:
static double GeodesicDistance (const DPoint2 &in, DPoint2 &out, bool
bQuick=false)
The 'in' parameter is a const reference, so that a temporary can be bound
to it.
The 'out' parameter is non-const, since it have to be modified. You have to
pass a named object as argument to 'out'.

A compiler, that compiles the original code, is broken. Which version of
VC++ is it?

--
Thomas
http://www.netmeister.org/news/learn2quote.html
Sep 11 '06 #4

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

Similar topics

2
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
39
by: Martin Jrgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
0
by: vve | last post by:
I'm discovering a strange behaviour in an C# project using ZedGraph (https://sourceforge.net/projects/zedgraph/). After adding a signal to it, it seems that the clr goes mad for some reason. I...
14
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used...
4
by: mainargv | last post by:
hi How do you rewrite codes with " ... va_list va_start va_etc", so that simple c compiler don't have to deal with them. I have written a simple c->verilog compiler but it can't deal with...
13
by: JohnQ | last post by:
The implementation of classes with virtual functions is conceptually easy to understand: they use vtables. Which begs the question about POD structs: how are they associated with their member...
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: 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
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
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,...
0
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...
0
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
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...
0
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 projectplanning, coding, testing,...
0
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...

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.