【问题标题】:SDL corrupt .drectveSDL 损坏的 .drectve
【发布时间】:2015-05-09 15:49:19
【问题描述】:

我刚刚安装了 SDL,它给了我一个警告,阻止它编译。

这是构建日志:

-------------- Build: Debug in Graphics (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\Users\73638G75MA\Documents\SDL2-2.0.3\lib\x86 -o bin\Debug\Graphics.exe obj\Debug\main.o  -lmingw32 -lSDL2main -lSDL2  
C:\Users\73638G75MA\Documents\SDL2-2.0.3\lib\x86/SDL2main.lib(./Release/SDL_windows_main.obj):(.text[_main]+0x0): multiple definition of `main'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):(.text.startup+0x0): first defined here
Warning: corrupt .drectve at end of def file
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 1 warning(s) (0 minute(s), 0 second(s))

和代码:

#include <iostream>
#include <SDL.h>

using namespace std;

int main(int argc, char *argv[]){
    SDL_Init(SDL_INIT_EVERYTHING);
    SDL_Quit();
    return 0;
}

【问题讨论】:

  • 您的代码中是否指定了main() 函数?似乎 SDL 为您提供了自己的(不同的)入口点。
  • @πάνταῥεῖ 我愿意,我也会放节目

标签: c++ mingw sdl


【解决方案1】:

我链接到了错误的 SDL\include 和 SDL\bin,链接到了 x64 而不是 x86

【讨论】:

    猜你喜欢
    • 2014-09-29
    • 1970-01-01
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-15
    • 1970-01-01
    • 2017-07-31
    相关资源
    最近更新 更多