Skip to main content

I've declared this class 'Robot' :

 #ifndef ROBOT_H
 #define ROBOT_H
 
 class Robot {
 
 private:
 
    static const int N_ROBOT_JOINTS = 5;    
    static const int JOINT_PARAM_D1
  = 275;  
    static const int JOINT_PARAM_A2 = 200;  
    static const int JOINT_PARAM_A3 = 130;  
    static const int JOINT_PARAM_D5 = 130;
 
 public:        
    Robot(); 
    float* forwardKinematics(int
  theta[N_ROBOT_JOINTS]);
 
 };
 
 #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

I've declared this class 'Robot' :

 #ifndef ROBOT_H
 #define ROBOT_H
 
 class Robot {
 
 private:
 
    static const int N_ROBOT_JOINTS = 5;    static const int JOINT_PARAM_D1
  = 275;     static const int JOINT_PARAM_A2 = 200;  static const int JOINT_PARAM_A3 = 130;  static const int JOINT_PARAM_D5 = 130;
 
 public:        Robot();    float* forwardKinematics(int
  theta[N_ROBOT_JOINTS]);
 
 };
 
 #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

I've declared this class 'Robot' :

 #ifndef ROBOT_H
 #define ROBOT_H
 
 class Robot {
 
 private:
 
    static const int N_ROBOT_JOINTS = 5;    
    static const int JOINT_PARAM_D1 = 275;  
    static const int JOINT_PARAM_A2 = 200;  
    static const int JOINT_PARAM_A3 = 130;  
    static const int JOINT_PARAM_D5 = 130;
 
 public:        
    Robot(); 
    float* forwardKinematics(int theta[N_ROBOT_JOINTS]);
 
 };
 
 #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

formatting
Source Link
Jasper
  • 11.9k
  • 6
  • 38
  • 56

I've declared this class 'Robot' :

> #ifndef ROBOT_H
> #define ROBOT_H
> 
> class Robot {
> 
> private:
> 
>    static const int N_ROBOT_JOINTS = 5;    static const int JOINT_PARAM_D1
> = 275;     static const int JOINT_PARAM_A2 = 200;  static const int JOINT_PARAM_A3 = 130;  static const int JOINT_PARAM_D5 = 130;
> 
> public:        Robot();    float* forwardKinematics(int
> theta[N_ROBOT_JOINTS]);
> 
> };
> 
> #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

I've declared this class 'Robot' :

> #ifndef ROBOT_H
> #define ROBOT_H
> 
> class Robot {
> 
> private:
> 
>   static const int N_ROBOT_JOINTS = 5;    static const int JOINT_PARAM_D1
> = 275;    static const int JOINT_PARAM_A2 = 200;  static const int JOINT_PARAM_A3 = 130;  static const int JOINT_PARAM_D5 = 130;
> 
> public:       Robot();    float* forwardKinematics(int
> theta[N_ROBOT_JOINTS]);
> 
> };
> 
> #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

I've declared this class 'Robot' :

 #ifndef ROBOT_H
 #define ROBOT_H
 
 class Robot {
 
 private:
 
    static const int N_ROBOT_JOINTS = 5;    static const int JOINT_PARAM_D1
 = 275;     static const int JOINT_PARAM_A2 = 200;  static const int JOINT_PARAM_A3 = 130;  static const int JOINT_PARAM_D5 = 130;
 
 public:        Robot();    float* forwardKinematics(int
 theta[N_ROBOT_JOINTS]);
 
 };
 
 #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics

Source Link
rflmota
  • 359
  • 2
  • 5
  • 7

Static Const Inaccessible in Class Definition (C++)

I've declared this class 'Robot' :

> #ifndef ROBOT_H
> #define ROBOT_H
> 
> class Robot {
> 
> private:
> 
>   static const int N_ROBOT_JOINTS = 5;    static const int JOINT_PARAM_D1
> = 275;    static const int JOINT_PARAM_A2 = 200;  static const int JOINT_PARAM_A3 = 130;  static const int JOINT_PARAM_D5 = 130;
> 
> public:       Robot();    float* forwardKinematics(int
> theta[N_ROBOT_JOINTS]);
> 
> };
> 
> #endif

Robot.cpp

#include "stdafx.h"
#include "Robot.h"
//#define _USE_MATH_DEFINES
//#include <math.h>

Robot::Robot(void)
{
}

float* forwardKinematics(int theta[Robot::N_ROBOT_JOINTS])
{
    float* array_fwdKin = new float[Robot::N_ROBOT_JOINTS];

    float p_x, p_y, p_z, pitch, roll;

    for (int i = 0; i < Robot::N_ROBOT_JOINTS; i++)
    {

    }

    return array_fwdKin;
}

but when i try to compile i get this error :

6 IntelliSense: member "Robot::N_ROBOT_JOINTS" (declared at line 9 of "e:\documents\visual studio 2012\projects\robotics kinematics\robotics kinematics\Robot.h") is inaccessible e:\Documents\Visual Studio 2012\Projects\Robotics Kinematics\Robotics Kinematics\Robot.cpp 10 43 Robotics Kinematics