我正在尝试编译我的第一个SDL程序,但它没有编译.顺便说一句,这不应该是关于设置库我想因为我认为我正确安装了库.
这是我的命令:
g++ main.cpp -o main -I/Library/Frameworks/SDL2.framework/Headers -framework SDL2
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
#include <iostream>
#include <SDL.h>
int main(int argc, char **argv){
if (SDL_Init(SDL_INIT_EVERYTHING) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}
SDL_Quit();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
调用:
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name main.cpp -mrelocation-model …Run Code Online (Sandbox Code Playgroud) 我正在学习python,正在从Dive into the Python这本书中学习.它说 :
内置
range函数返回一个整数列表.在最简单的形式中,它采用上限并返回从零开始的列表,计数到但不包括上限.
根据它所说的,它返回一个列表.我以为我可以用追加函数为它附加一个值,但我不能.
>>> l = range(7)
>>> l
[0, 1, 2, 3, 4, 5, 6]
>>> l.append(13)
>>> l
[0, 1, 2, 3, 4, 5, 6, 13]
>>> l = range(7).append(13)
>>> l
Run Code Online (Sandbox Code Playgroud)
它没有打印任何东西,原因是什么?