Ubuntuでのコンパイル時のエラーについて
先日、仮想空間上にUbuntuを導入し、更にそこにSDL2をダウンロードしてプログラムを作ったところ、以下のようなメッセージがコンパイル時に出ました。(もっと上にもあるのですが下部の方だけとさせていただきます・・・)
USB上の実行ファイルを動作させることは一応できますが、新たに端末上でmakeやコンパイルを行えない状況です
発生している問題・エラーメッセージ
/usr/include/SDL2/SDL_version.h:51:16: error: redefinition of ‘struct SDL_version’ typedef struct SDL_version ^ In file included from /usr/local/include/SDL2/SDL.h:59:0, from kadai1.c:2: /usr/local/include/SDL2/SDL_version.h:51:16: note: originally defined here typedef struct SDL_version ^ In file included from /usr/include/SDL2/SDL.h:57:0, from /usr/include/SDL2/SDL2_gfxPrimitives.h:38, from kadai1.c:3: /usr/include/SDL2/SDL_version.h:56:3: error: conflicting types for ‘SDL_version’ } SDL_version; ^ In file included from /usr/local/include/SDL2/SDL.h:59:0, from kadai1.c:2: /usr/local/include/SDL2/SDL_version.h:56:3: note: previous declaration of ‘SDL_version’ was here } SDL_version; ^ In file included from /usr/include/SDL2/SDL.h:57:0, from /usr/include/SDL2/SDL2_gfxPrimitives.h:38, from kadai1.c:3: /usr/include/SDL2/SDL_version.h:133:30: error: conflicting types for ‘SDL_GetVersion’ extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); ^ In file included from /usr/local/include/SDL2/SDL.h:59:0, from kadai1.c:2: /usr/local/include/SDL2/SDL_version.h:133:30: note: previous declaration of ‘SDL_GetVersion’ was here extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
該当のソースコード
コンパイルしようとしたソースのヘッダです
C
1#include <stdio.h> 2#include <SDL2/SDL.h> 3#include <SDL2/SDL2_gfxPrimitives.h> 4#include <SDL2/SDL_ttf.h> 5 6
試したこと
こちらのサイトのインストールも試しましたが、うまく行きません。
https://www.google.com/search?client=ubuntu&channel=fs&q=SDL2&ie=utf-8&oe=utf-8
補足情報(FW/ツールのバージョンなど)
sudo apt-get install -y libsdl2-dev libsdl2-image-dev
libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev
libsdl2-gfx-dev
一番最初に以上のようにSDL2ライブラリをダウンロードしました。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。