hi,
my project has a header file structure.h which has the following code
[code=cpp]
#ifndef STRUCTURE_H
#define STRUCTURE_H
#include <stdio.h>
typedef struct
{
float x,y,z;
}position_s ;
typedef struct
{
float r,g,b,a;
}color_s ;
typedef struct
{
int size;
bool blend;
position_s pos;
color_s colour;
}point_s;
extern point_s dp[];
#endif
[/code]
I need to create a dynamic array of point_s structure objects ( the array may be as large as a million depending on the number of points present in a file).
one .cpp file is used for reading a file( of specific format which gives x y z r g b values) and these values shud be stored in the structure objects ( objects in the array dp).
this array shud be accessible to another .cpp file which displays the points on a 3D window.
I have included structure.h in both the files but it gives a build error
filehandling.ob j : error LNK2019: unresolved external symbol "struct point_s * dp" (?dp@@3PAUpoint _s@@A) referenced in function "void __cdecl fileopen2(void) " (?fileopen2@@YA XXZ)
fatal error LNK1120: 1 unresolved externals
Can anyone help me with this?
thank you.
my project has a header file structure.h which has the following code
[code=cpp]
#ifndef STRUCTURE_H
#define STRUCTURE_H
#include <stdio.h>
typedef struct
{
float x,y,z;
}position_s ;
typedef struct
{
float r,g,b,a;
}color_s ;
typedef struct
{
int size;
bool blend;
position_s pos;
color_s colour;
}point_s;
extern point_s dp[];
#endif
[/code]
I need to create a dynamic array of point_s structure objects ( the array may be as large as a million depending on the number of points present in a file).
one .cpp file is used for reading a file( of specific format which gives x y z r g b values) and these values shud be stored in the structure objects ( objects in the array dp).
this array shud be accessible to another .cpp file which displays the points on a 3D window.
I have included structure.h in both the files but it gives a build error
filehandling.ob j : error LNK2019: unresolved external symbol "struct point_s * dp" (?dp@@3PAUpoint _s@@A) referenced in function "void __cdecl fileopen2(void) " (?fileopen2@@YA XXZ)
fatal error LNK1120: 1 unresolved externals
Can anyone help me with this?
thank you.
Comment