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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:10:47+00:00 2026-06-10T05:10:47+00:00

This seems like a problem that is common. I defined an enum in classA

  • 0

This seems like a problem that is common. I defined an enum in classA and then included classA in classB. Then, in classB I defined a function which returns the enum type defined in classA…see below. I get the following error:

aFirst.obj : error LNK2019: unresolved external symbol “public: enum justEnum::things_t __thiscall usesTheEnum::returnsThings(void)” (?returnsThings@usesTheEnum@@QAE?AW4things_t@justEnum@@XZ) referenced in function _wmain
1>C:\Documents and Settings\Ben\My Documents\Visual Studio 2010\Projects\aFirst\Debug\aFirst.exe : fatal error LNK1120: 1 unresolved externals

#pragma once
class justEnum
{

public:
    justEnum(void);
    ~justEnum(void);
    enum things_t{ONE, TWO};
};



#pragma once
#include "justEnum.h"

class usesTheEnum
{
public:
    usesTheEnum(void);
    ~usesTheEnum(void);
    justEnum::things_t returnsThings(void);
};



#include "StdAfx.h"
#include "usesTheEnum.h"
#include "justEnum.h"

usesTheEnum::usesTheEnum(void)
{
}


usesTheEnum::~usesTheEnum(void)
{
}


justEnum::things_t returnsThings()
{
    return justEnum::ONE;
}



// tester.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include "justEnum.h"
#include "usesTheEnum.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    usesTheEnum aUser;
    justEnum anEnum;
    justEnum::things_t anotherEnum;
    anotherEnum = justEnum::ONE;
    aUser.returnsThings();
    cout << anotherEnum;
    return 0;
}
  • 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-06-10T05:10:48+00:00Added an answer on June 10, 2026 at 5:10 am

    You need to specify that your definition of returnsThings() is part of the usesTheEnum class.

    justEnum::things_t usesTheEnum::returnsThings()
    {
        return justEnum::ONE;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like a simple problem: I have a WF4 activity that guides the
I have an issue that seems like very flaky behavour, is this a problem
This seems like a very simple and a very common problem. The simplest example
This seems like a pretty common problem, but I haven't found any sort of
This seems to be a fairly common problem, but the solutions that I have
This seems like a common problem, but I'm unable find an adequate solution. I'm
This seems like it should be a common problem but I'm having trouble finding
All, this seems like a simple problem but it's giving me fits. Lets say
Ok, so this seems like a really silly problem but I can't get my
Seems like just yesterday I had this same problem with Play! v1. After trying

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.