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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:02:39+00:00 2026-05-31T04:02:39+00:00

I am working on making a physics engine (with the help of a book),

  • 0

I am working on making a physics engine (with the help of a book), and the book suggests that I create a namespace for the engine to exist in, and for the first part I declare a ‘typedef’ for variables like so

typedef float real;

and I can understand the explanation that the author gives being that “if precision needs change then you can just go to this one line, and change it, and then maybe have to change at most 10 helper functions, and clarity of representation, but I think it coincides with the other two things, so I hope this is follow-able.

the book asks that I define the typedef, and helper functions in one file (to minimize file hopping if change is needed), and then include that before the other files are compiled, and to do all of this in a namespace (I named Physics), then in another file create classes to be used in the engine. though the direct problem is with intellisense, and resolving

genFunction.h
namespace Physics{
typedef float real;
}


Classes.h
#include "genFunction.h"
namespace Physics{
class Vector3{
public :
    real x;   // visual studio is throwing that Physics::real is not a type name
    real y;
    real z;
    // VS is not offering collapsing, or any form of 
    // auto/assistance with lines.
    // almost like it does not want me to have classes
    // in my own namespaces
    Vector3(){ // uncolapsable 
        x = 0;
        y = 0;
        z = 0;
    }
};
}

am I doing anything wrong considering that the compiler is ignoring that I have done a typedef, and it is upscope of where the issue is occurring, and then the fact that VS isn’t even showing suggestions while I am inside a class in a self made namespace troubles me slightly.

Edit: primary solution found to resolution of type. apparently instead of a { I put a ( on one of the methods, and that caused it to act like the entire namespace didn’t exist. though VS will still not give me any kind of assistance (function/class/namespace collapsing, or completion suggestions even with ctrl+spacebar) also I have some helper functions that I use (self made pow(), sqrt() ) that I use that cause linker errors if not in a class, but this goes away when I put inline on them. is this a bad thing to resolve a linker?

  • 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-31T04:02:41+00:00Added an answer on May 31, 2026 at 4:02 am

    First of all, the compiler isn’t throwing anything.
    Since you haven’t said otherwise, I’m assuming your code compiles fine. The problem is with Intellisense then, and nothing more.

    Intellisense in C++ is notoriously shaky. Sometimes it works, sometimes it doens’t. It may depend on the phases of the moon.

    Sometimes you can “encourage” it a bit by being more explicit. If you type ::, it should suggest all the members of the global namespace. ::Physics:: and it should suggest members of the Physics namespace.

    It might just be a matter of waiting (or restarting VS or rebuilding?) until it decides to reparse your code.

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

Sidebar

Related Questions

I'm working on a web page where I'm making an AJAX call that returns
I'm working with some example java code for making md5 hashes. One part converts
working on making a flash program that loads about 1000 jpegs and then plays
I am working on making a paged app that will load a separate HTML
I'm working on making a website/web application that displays images every 5 or so
I am working on making an application that will store information, and for user
Working on making an inventory page for work. I have written a page that
I am working on making an address book in C# 2008. I need to
Im currently working on making a flash platformer engine...but my collision detect needs some
I'm working on making a site fully functional under HTTPS. As part of this,

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.