Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefile作成と対応するコンパイラについて #32

Open
yumetodo opened this issue Jan 12, 2016 · 3 comments
Open

makefile作成と対応するコンパイラについて #32

yumetodo opened this issue Jan 12, 2016 · 3 comments

Comments

@yumetodo
Copy link
Collaborator

#1 (comment)
で対応するコンパイラについて話があって、VS2013以降、という話になりましたが、 #29 でもわかるように見直しが必要そうです。

提案ですが

  • Visual Studio 2013 Nomebver CTPをサポートしない(std::enable_ifが使いものにならない)
  • Visual Studio 2015をサポートしない(バグが多すぎる、とてもRelease版とは思えない)
  • Clang with Microsoft CodeGenをサポート(まだpreview releaseで、バグも多いががClangそのものが優秀なので十分使える)
  • Visula Studio 2015 Update 1をサポートする(ようやく使えるれべるになった)

という感じで

  • Visual Studio 2013 Update 5
  • Visual Studio 2015 Update 1
  • Clang with Microsoft CodeGen(clang 3.7)

を対応コンパイラとしてはどうでしょうか。

DxLibをmsys2のgccやclangでコンパイルする方法があればそれもサポートしたいのですが、やり方がわかりませんし

@Nagarei
Copy link
Owner

Nagarei commented Jan 13, 2016

それで良いと思います。

DxLibをmsys2のgccやclangでコンパイルする方法があれば

DxLib本家でMinGWの.aファイルは公開されていますが、msys2とMinGWで.aファイルを混ぜることは可能かどうかわかりますか?

@yumetodo
Copy link
Collaborator Author

だめですね。管理人さんに頼んだらmakefileくれないかな・・・

追記
というわけで、ダメ元で聞いてみました
http://hpcgi2.nifty.com/natupaji/bbs/patio.cgi?mode=view&no=3738

$ g++ `pkg-config DxLib --cflags --libs` -std=c++14 -O2 -o dxlib_test.exe dxlib_test.cpp
D:\msys64\tmp\ccLY8WbO.o:dxlib_test.cpp:(.text+0x4): undefined reference to `DxLib::DxLib_Init()'
D:\msys64\tmp\ccLY8WbO.o:dxlib_test.cpp:(.text+0x25): undefined reference to `DxLib::GetColor(int, int, int)'
D:\msys64\tmp\ccLY8WbO.o:dxlib_test.cpp:(.text+0x3d): undefined reference to `DxLib::DrawPixel(int, int, unsigned int)'
D:\msys64\tmp\ccLY8WbO.o:dxlib_test.cpp:(.text+0x42): undefined reference to `DxLib::WaitKey()'
D:\msys64\tmp\ccLY8WbO.o:dxlib_test.cpp:(.text+0x47): undefined reference to `DxLib::DxLib_End()'
collect2.exe: error: ld returned 1 exit status

pkg-configはこんなかんじ

prefix=/mingw32
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
sharedlibdir=${exec_prefix}/bin
includedir_old=${prefix}/include/DxLib
includedir_new=${prefix}/include

Name: DxLib
Description: DxLib compression library
Version: 3.16

Requires:
Libs: -L${libdir} -lDxLib -lDxUseCLib -lDxDrawFunc -ljpeg -lpng -lzlib -ltiff -ltheora_static -lvorbis_static -lvorbisfile_static -logg_static -lbulletdynamics -lbulletcollision -lbulletmath

Cflags: -I${includedir_old} -I${includedir_new} -DDX_GCC_COMPILE -DDX_NON_INLINE_ASM

.\DxLib_GCC\プロジェクトに追加すべきファイル_GCC(MinGW)用\5_2_0_w64\i686
の中身のうち、.h
/mingw32/include/DxLib
.a
/mingw32/libにいれてます。

gccは

$ gcc -v
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.2.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-5.2.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --with-gxx-include-dir=/mingw32/include/c++/5.2.0 --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev4, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 5.2.0 (Rev4, Built by MSYS2 project)

ソースコードは
http://homepage2.nifty.com/natupaji/DxLib/use/dxuse_gcc.html
より

#include "DxLib.h"

// プログラムは WinMain から始まります
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
                        LPSTR lpCmdLine, int nCmdShow )
{
    if( DxLib_Init() == -1 )        // DXライブラリ初期化処理
    {
        return -1 ;         // エラーが起きたら直ちに終了
    }

    DrawPixel( 320 , 240 , GetColor( 255,255,255 ) ) ;  // 点を打つ

    WaitKey() ;             // キー入力待ち

    DxLib_End() ;               // DXライブラリ使用の終了処理

    return 0 ;              // ソフトの終了 
}

yumetodo added a commit that referenced this issue Jan 20, 2016
yumetodo added a commit that referenced this issue Jan 20, 2016
@yumetodo
Copy link
Collaborator Author

管理人さんにmakefileもらえたので2月になったらいろいろ試してみようかと思っています。

@yumetodo yumetodo changed the title 対応するコンパイラについて makefile作成と対応するコンパイラについて Jan 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants