Xcode build prints this error .
Undefined symbols:
"EGViewportDimensionMake(unsigned int, unsigned int, unsigned int, unsigned int)", referenced from: -[Renderer render] in Renderer.o ld: symbol(s) not found collect2: ld returned 1 exit status
I cannot figure out what's the problem. I'm not good at classic C syntax. These are the function source code files:
EGViewportDimension.h
#import <Foundation/Foundation.h>
struct EGViewportDimension
{
NSUInteger x;
NSUInteger y;
NSUInteger width;
NSUInteger height;
};
typedef struct EGViewportDimension EGViewportDimension;
EGViewportDimension EGViewportDimensionMake(NSUInteger x, NSUInteger y, NSUInteger width, NSUInteger height);
EGViewportDimension.m
#import "EGViewportDimension.h"
EGViewportDimension EGViewportDimensionMake(NSUInteger x, NSUInteger y, NSUInteger width, NSUInteger height)
{
EGViewportDimension dim;
dim.x = x;
dim.y = y;
dim.width = width;
dim.height = height;
return dim;
}
I referenced and used this like:
Renderer.mm
#import "EGViewportDimension.h"
//.... many codes omitted.
EGViewportDimension vdim = EGViewportDimensionMake(0, 0, backingWidth, backingHeight);