Including GSL Source Code to Project, Defines/Macros not found in Project

Viewed 36

I am currently creating an iOS react-native App which has to use a 2d wavelet transformation. My backend is in C++, so I am using the gsl (GNU Scientific Library, .c and .h) source files, since the brew installation is not supported on iOS und there is no pod existing for gsl as far as I know.

I have added all the source files and headers (only .c and .h files) to my XCode project (right-click on my project in XCode using Add Files to "Project Name) and also adjusted the includes in these files so every header is found. But running my app without using any function call or including any header to my files at all, I receive a compilation error at FUNCTION in init_source.c:

TYPE (gsl_matrix) *
FUNCTION(gsl_matrix, alloc) (const size_t n1, const size_t n2) 
{
 //function body
}

expected function body after function declarator

How do I properly add the source code/headers with those defines to my project? Do I have to add any path to my Linker Flags, Header Search Paths or Library Search Paths so the defines are found?

The Function call above is gsl_matrix_alloc(..);.

FUNCTIONis a define in templates_on.h.

#if defined(BASE_DOUBLE)
#define FUNCTION(dir,name) CONCAT2(dir,name)
#define TYPE(dir) dir
#define VIEW(dir,name) CONCAT2(dir,name)
#define QUALIFIED_TYPE(dir) TYPE(dir)
#define QUALIFIED_VIEW(dir,name) CONCAT2(dir,name)
#else
#define FUNCTION(a,c) CONCAT3(a,SHORT,c)
#define TYPE(dir) CONCAT2(dir,SHORT)
#define VIEW(dir,name) CONCAT3(dir,SHORT,name)
#define QUALIFIED_TYPE(dir) TYPE(dir)
#define QUALIFIED_VIEW(dir,name) CONCAT3(dir,SHORT,name)
#endif

CONCAT2and CONCAT3 are defined in the same file as:

#define CONCAT2x(a,b) a ## _ ## b 
#define CONCAT2(a,b) CONCAT2x(a,b)
#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
0 Answers
Related