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 889387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:33:33+00:00 2026-05-15T13:33:33+00:00

I’ve got the following setup. RectangleT class defined in a header file in a

  • 0

I’ve got the following setup. RectangleT class defined in a header file in a library. Attempted to use the class in my main application. When linking I get an error for every function I try to call – except constructor and the GetLeft/GetTop/GetRight/GetBottom – BUT – I do get the error when calling GetWidth / GetHeight.

Here’s the code I’ve got for a simple template class.

namespace My2D
{
    template <typename T>
    class MY2D_API RectangleT
    {
    public:     // Construction
        RectangleT(const T left = 0, const T top = 0, const T right = 0, const T bottom = 0)
            : m_left(left)
            , m_top(top)
            , m_right(right)
            , m_bottom(bottom)
        {
        }

        RectangleT(const RectangleT<T> &source)
            : m_left(source.m_left)
            , m_top(source.m_top)
            , m_right(source.m_right)
            , m_bottom(source.m_bottom)
        {
        }

        virtual ~RectangleT(void)
        {
        }

    public:     // Getters / setters
        T GetLeft() const { return m_left; }
        T GetTop() const { return m_top; }
        T GetRight() const { return m_right; }
        T GetBottom() const { return m_bottom; }
        T GetWidth() const { return m_right - m_left; }
        T GetHeight() const { return m_bottom - m_top; }

        void SetLeft(const T value) { m_left = value; }
        void SetTop(const T value) { m_top = value; }
        void SetRight(const T value) { m_right = value; }
        void SetBottom(const T value) { m_bottom = value; }

    protected:  // Members
        T m_left;
        T m_top;
        T m_right;
        T m_bottom;
    };
}

Anyone got any ideas?!

  • 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-15T13:33:34+00:00Added an answer on May 15, 2026 at 1:33 pm

    I removed compiler directive MY2D_API and tried your code, it works fine, see below.

    Windows 7, MS VS 2010

    int main ()
    {
      My2D::RectangleT < int > rect;
    
      rect.SetBottom(3);
      rect.SetLeft(3);
      rect.SetRight(8);
      rect.SetTop(8);
      return rect.GetHeight();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

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.