Skip to content

Commit

Permalink
Fixed Unresolved external symbol G__ due to export issue in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh1998 committed Oct 3, 2024
1 parent eb6329c commit 61b39d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/gis/G.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include <grass/config.h>
#include <grass/gis.h>

#ifdef GRASS_CMAKE_BUILD
#include <export/grass_gis_export.h>
#else
#define GRASS_GIS_EXPORT
#endif

struct G__ /* Structure of library globals */
{
struct Cell_head window; /* Contains the current window */
Expand All @@ -9,4 +15,4 @@ struct G__ /* Structure of library globals */
int compression_level; /* zlib compression level */
};

extern struct G__ G__; /* allocated in gisinit */
GRASS_GIS_EXPORT extern struct G__ G__; /* allocated in gisinit */
5 changes: 4 additions & 1 deletion lib/gis/gisinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
#include "G.h"
#include "gis_local_proto.h"

#if 0
#ifdef GRASS_CMAKE_BUILD
#include <export/grass_gis_export.h>
#else
#define GRASS_GIS_EXPORT
#endif
struct G__ G__;
#endif

GRASS_GIS_EXPORT struct G__ G__;

/** initialized is set to 1 when engine is initialized */
/* GRASS_GIS_EXPORT static int initialized on windows msvc throws below error.
Expand Down

0 comments on commit 61b39d9

Please sign in to comment.