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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:26:46+00:00 2026-05-11T13:26:46+00:00

I have a C++/CLI class library project in VS2005 that i am having some

  • 0

I have a C++/CLI class library project in VS2005 that i am having some problems with. I have defined a class called Languages which is a an enum class. which looks like this:

'Language.cpp' namespace Company {     namespace product     {         public eunm class Languages : int         {             English = 1,             German = 2,             //etc for other languages         };     } }; 

I then have another class that tries to references this which lives in the same namespace:

'Language.cpp' namespace Company {     namespace product     {         public class LanguageConsumer         {         public:             LanguageConsumer()             {             }         public:             Languages DoSomething(Languages input)         {             if (input == Languages::English)             {                 //Do something and return             }         };     } }; 

However my project doensn’t compile. From what i can figure out the different classes can’t see each other even thought they are in the same namespace. I assume that i might need to have header files and #includes for the header files but i just don’t know enough about C++/CLI to be sure (i come from C# background with hardly any C experience) and i have tried as many different combinations as i can think of. I’m sure i’m missing something very obvious to anybody who knows what they are doing, but alas i do not.

Thanks in advance.

  • 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. 2026-05-11T13:26:47+00:00Added an answer on May 11, 2026 at 1:26 pm

    C++/CLI still compiles like C++, file files are compiled separately and then linked together. This is different from C# which compiles all the files together. At compile time the files don’t know about each other so the code doesn’t compile (what is this enum?!). You need to have the enum definition in the same file (compilation unit) as the class.

    The simple way to do this is to move the code into the same file. The header file solution is to move the enum definition into a header file and then include it (#include) in the other file. #include inserts the text of another file, giving the same effect.

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

Sidebar

Ask A Question

Stats

  • Questions 206k
  • Answers 206k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If I understand you correctly, try this: $('#viewContainerTop > [class^=row]').not('.row2').hide();… May 12, 2026 at 9:05 pm
  • Editorial Team
    Editorial Team added an answer You will need to use Authorization Services to authorize the… May 12, 2026 at 9:05 pm
  • Editorial Team
    Editorial Team added an answer Transferred all my files in a Unix box and made… May 12, 2026 at 9:05 pm

Related Questions

I have a C++ DLL (no code) that I want to expose to .NET
When creating a DLL with Visual C++ 2008 I have a couple of choices.
I'm sorry if this question has already been answered but I couldn't find it.
I've got a medium scale project (a turn-based game) that's currently written in C/C++.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.