Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6068117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:40:52+00:00 2026-05-23T09:40:52+00:00

I am relatively new to C++ programming and building a small program in Dev

  • 0

I am relatively new to C++ programming and building a small program in Dev C++ which is producing the following compiler output:

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\s0237326\My Documents\Postgrad_Research_Sync_Folder\C_Projects\mfemm2\Makefile.win"
Executing  make...
make.exe -f "C:\Documents and Settings\s0237326\My Documents\Postgrad_Research_Sync_Folder\C_Projects\mfemm2\Makefile.win" all
g++.exe -c NOSEBL.CPP -o NOSEBL.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   

NOSEBL.CPP: In member function `double femmedata::CNode::GetDistance(double, double)':
NOSEBL.CPP:24: error: cannot convert `CComplex' to `double' in return

NOSEBL.CPP: In member function `double femmedata::CBlockLabel::GetDistance(double, double)':
NOSEBL.CPP:108: error: cannot convert `CComplex' to `double' in return

make.exe: *** [NOSEBL.o] Error 1

Execution terminated

The problem is with the implementation of my CNode class, with the ‘femmedata::CNode::GetDistance(double, double)’ function shown below, with line number to show the error location.

22 double CNode::GetDistance(double xo, double yo)
23  {
24      return sqrt((x-xo)*(x-xo) + (y-yo)*(y-yo));
25  }

The definition of the CNode class is shown below:

class CNode
{
    public:
        CNode();

        double x,y;
        int xs,ys;
        bool IsSelected;
        CStdString BoundaryMarker;
        int InGroup;

        double GetDistance(double xo, double yo);
        CComplex CC();
        void ToggleSelect();

    private:

};

The CNode class is declared in NOSEBL.h, and the implementation contained in NOSEBL.cpp. These files also contain other class definitions and implementations. However, the CComplex type is defined elsewhere in complex.h and complex.cpp, and introduced here through including the header file.

I built the program previously in VC++ 2010 Express Edition with no problems, so I don’t know what the problem is here. In case it is relevant, the next few lines of text after the GetDistance function are shown below, which do reference the CComplex type.

CComplex CNode::CC()
{
    return CComplex(x,y);
}

Thanks

EDIT 1

NOSEBL.CPP: In member function `double femmedata::CNode::GetDistance(double, double)':
NOSEBL.CPP:24: error: `class CComplex' used where a floating point value was expected
NOSEBL.CPP:24: error: aggregate value used where a float was expected

NOSEBL.CPP: In member function `double femmedata::CBlockLabel::GetDistance(double, double)':
NOSEBL.CPP:108: error: cannot convert `CComplex' to `double' in return

make.exe: *** [NOSEBL.o] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:40:53+00:00Added an answer on May 23, 2026 at 9:40 am

    The problem is that you are getting the wrong sqrt function. You appear to have included the <complex> header but not the <cmath> header. The double parameter is being promoted to a complex parameter because the version of sqrt that takes a double is not known to the compiler at that point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to programming with Qt and had a question. Short version:
I am relatively new to programming. My work basically revolves around data and analysis.
I'm relatively new to programming so excuse me if I get some terms wrong
I really need your help for this. I am relatively new to programming and
Being relatively new to functional programming, I expend lots of energy wondering is this
I'm relatively new to .NET programming (and OOP in general) and I want to
I'm relatively new to web application programming so I hope this question isn't too
I am relatively new to world of programming. I have a few performance questions:
I'm relatively new to Python and am having problems programming with Scapy, the Python
I am relatively new to Cocoa programming, and some aspects of memory managing are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.