Xcode build 打印此错误。
未定义符号:
“EGViewportDimensionMake(unsigned int, unsigned int, unsigned int, unsigned int)”,引用自:-[Renderer render] in Renderer.o ld:未找到符号 collect2:ld 返回 1 个退出状态
我无法弄清楚有什么问题。我不擅长经典的 C 语法。这些是函数源代码文件:
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;
}
我引用并使用了这个:
渲染器.mm
#import "EGViewportDimension.h"
//.... many codes omitted.
EGViewportDimension vdim = EGViewportDimensionMake(0, 0, backingWidth, backingHeight);