my project has a header file structure.h which has the following code
Expand|Select|Wrap|Line Numbers
- #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
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.obj : error LNK2019: unresolved external symbol "struct point_s * dp" (?dp@@3PAUpoint_s@@A) referenced in function "void __cdecl fileopen2(void)" (?fileopen2@@YAXXZ)
fatal error LNK1120: 1 unresolved externals
Can anyone help me with this?
thank you.