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

  • SEARCH
  • Home
  • 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 1044819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:53:20+00:00 2026-05-16T15:53:20+00:00

I am porting some code from linux to windows and am coming up with

  • 0

I am porting some code from linux to windows and am coming up with some strange error. I have the following class:

(header)
RegionRectangle.h

#ifndef __RECTANGLE_H__
#define __RECTANGLE_H__
#include <iostream>
using namespace std;
class Rectangle
{
public:
    Rectangle(int x = 0,int y = 0,int width = 0,int height = 0, int threshold=0);
    int x();
    int y();
    int width();
    int height();
    void x(int);
    void y(int);
    void width(int);
    void height(int);
    void threshold(int);
    int threshold(void);
    friend ostream& operator<<(ostream& output, const Rectangle& r);
private:
    int _x;
    int _y;
    int _width;
    int _height;
    int _threshold;
};

#endif

(implementation)

RegionRectangle.cpp

#include "RegionRectangle.h"

Rectangle::Rectangle(int myx,int myy, int mywidth, int myheight,int threshold)
{
    _x=myx;
    _y=myy;
    _width=mywidth;
    _height=myheight;
    _threshold=threshold;
}
int Rectangle::x(void)
{
    return _x;
}
int Rectangle::y(void)
{
    return _y;
}
int Rectangle::width(void)
{
    return _width;
}
int Rectangle::height(void)
{
    return _height;
}

void Rectangle::x(int x)
{
    _x=x;
}

void Rectangle::y(int y)
{
    _y=y;
}

void Rectangle::width(int width)
{
   _width=width;
}

void Rectangle::height(int height)
{
    _height=height;
}
void Rectangle::threshold(int thresh)
{
    _threshold=thresh;
}
int Rectangle::threshold(void)
{
    return _threshold;
}

ostream& operator&lt;&lt;(ostream& output, const Rectangle& p)
{
    output << "[ (" << p._x << "," << p._y << "," << p._width << "," << p._height << "), threshold: " << p._threshold << " ]";
    return output;
}

I have another header file that has a function as such:

bool hasKey( map<PageNumberSide, list<Rectangle> > myMap, PageNumberSide myKey);

The error messages I’m getting are these:

enter code here

This third referencing file does include RegionRectangle.h any ideas why this would not work?

1>  Utils.cpp
1>c:\documents and settings\ferru001\my documents\work\cira_svn\win32_cira\Utils.h(56): error C2923: 'std::list' : 'Rectangle' is not a valid template type argument for parameter '_Ty'
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\wingdi.h(3989) : see declaration of 'Rectangle'
1>c:\documents and settings\ferru001\my documents\work\cira_svn\win32_cira\Utils.h(60): error C2923: 'std::list' : 'Rectangle' is not a valid template type argument for parameter '_Ty'
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\wingdi.h(3989) : see declaration of 'Rectangle'
  • 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-16T15:53:20+00:00Added an answer on May 16, 2026 at 3:53 pm

    The key is:

    C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\wingdi.h(3989)
    : see declaration of ‘Rectangle’

    The compiler thinks you’re referring to the Win32 SDK Rectangle function in wingdi.h, not the one you just defined. I suggest renaming your rectangle (or putting in a namespace) and seeing what happens.

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

Sidebar

Related Questions

I am porting some code from windows to Linux (Ubuntu 9.10). I have a
I'm porting some (working) code from Linux to Windows 8. I'm using DDK. typedef
I am porting some legacy code from windows to Linux (Ubuntu Karmic to be
I have some code, that I'm currently porting from OS X to Linux (console
Some working C++ code that I'm porting from Linux to Windows is failing on
I am porting some C++ code from Unix to Linux (Red Hat). I have
I'm porting some code from other language to Ruby, in my Class I need
I'm porting over some templated code from Windows and I'm hitting some compiler differences
I am doing some cross-platform work, porting code from Linux to Win32, but when
I'm in the process of porting some code from Linux to Mac OS X.

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.