我发现在使用-rpath时必须给出-L标志.例如:
gcc -o test test.o -L. -lmylib -Wl,-rpath=.
Run Code Online (Sandbox Code Playgroud)
为什么需要-L标志?编译时需要哪些信息比h文件中的信息多?
如果我删除-L.我收到以下消息:
gcc -o test test.o -lmylib -Wl,-rpath=.
/usr/bin/ld: cannot find -lmyLib
Run Code Online (Sandbox Code Playgroud)
但是,删除这两个标志是完全可以的.像这样:
gcc -o test test.o -lmylib
Run Code Online (Sandbox Code Playgroud)
前提是可以在/ usr/lib中找到libmyLib.为什么现在不需要-L?
这是/sf/answers/593761591/的后续问题.
我现在已经为下面的问题提交了一个错误。有人有好的解决方法吗?
我尝试保存一个SKTexture文件,然后再次加载它,但我没有成功。可以将以下代码片段复制到Xcode 启动项目中的GameScene.m。
我使用textureFromNodein generateTexture,这似乎是我问题的根本原因。如果我使用精灵的纹理,则代码有效,并且可以看到两艘宇宙飞船。
此代码在 iOS 8 中有效,但在 Xcode7 和 iOS 9 中停止工作。我只想在提交错误报告之前验证这是一个错误。我担心的是我做错了什么NSKeyedArchiver。
它发生在模拟器和设备上。
#import "GameScene.h"
@implementation GameScene
// Generates a texture
- (SKTexture *)generateTexture
{
SKScene *scene = [[SKScene alloc] initWithSize:CGSizeMake(100, 100)];
SKShapeNode *shapeNode = [SKShapeNode shapeNodeWithRectOfSize:CGSizeMake(50, 50)];
shapeNode.position = CGPointMake(50, 50);
shapeNode.strokeColor = SKColor.redColor;
shapeNode.lineWidth = 10;
[scene addChild:shapeNode];
SKTexture *texture = [self.view textureFromNode:scene];
//SKTexture *texture = [SKSpriteNode spriteNodeWithImageNamed:@"Spaceship"].texture; // This works!
return texture;
}
// Just generate …Run Code Online (Sandbox Code Playgroud) C99表示整数类型,如uint32_t,int16_t等,其中很容易看到使用的位数.很高兴知道嵌入式编程.
我没有找到浮点值的任何类似类型.有标准吗?如果没有,为什么?