小编yun*_*din的帖子

链接器命令失败,sdl

我正在尝试编译我的第一个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)

c++ sdl clang

2
推荐指数
1
解决办法
5254
查看次数

将值附加到函数范围的返回值()

我正在学习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)

它没有打印任何东西,原因是什么?

python list python-2.x

1
推荐指数
1
解决办法
59
查看次数

标签 统计

c++ ×1

clang ×1

list ×1

python ×1

python-2.x ×1

sdl ×1