#8
by Meta3 » 4年前
VisualStudio2019コマンドラインではコンパイル・リンク cl
です
dxlib では cl /Ic:\dxlib g1.cpp /link /LIBPATH:"c:\dxlib"
でコンパイル・リンクできます
コード:
c:\b\p\g>g.bat
c:\b\p\g>del g1.exe
c:\b\p\g>cl /Ic:\dxlib g1.cpp /link /LIBPATH:"c:\dxlib"
Microsoft(R) C/C++ Optimizing Compiler Version 19.28.29335 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
g1.cpp
Microsoft (R) Incremental Linker Version 14.28.29335.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:g1.exe
/LIBPATH:c:\dxlib
g1.obj
c:\b\p\g>g1.exe
g1.cpp
コード:
#include "DxLib.h"
int main(){
// int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); //ウィンドウモード変更と初期化と裏画面設定
int x=0, y=0;
int Green = GetColor( 255, 255, 0 ); // 緑の色コードを取得
// while(裏画面を表画面に反映, メッセージ処理, 画面クリア)
while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 ){
DrawFormatString( x % 600, y % 480, Green, "座標[%d,%d]", x, y ); // 文字を描画する
x = x + 1; // x座標を1加算
y = y + 1; // y座標を1加算
}
DxLib_End(); // DXライブラリ終了処理
return 0;
}
VisualStudio2019コマンドラインではコンパイル・リンク cl
です
dxlib では cl /Ic:\dxlib g1.cpp /link /LIBPATH:"c:\dxlib"
でコンパイル・リンクできます
[code]c:\b\p\g>g.bat
c:\b\p\g>del g1.exe
c:\b\p\g>cl /Ic:\dxlib g1.cpp /link /LIBPATH:"c:\dxlib"
Microsoft(R) C/C++ Optimizing Compiler Version 19.28.29335 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
g1.cpp
Microsoft (R) Incremental Linker Version 14.28.29335.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:g1.exe
/LIBPATH:c:\dxlib
g1.obj
c:\b\p\g>g1.exe
[/code]
g1.cpp
[code]#include "DxLib.h"
int main(){
// int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); //ウィンドウモード変更と初期化と裏画面設定
int x=0, y=0;
int Green = GetColor( 255, 255, 0 ); // 緑の色コードを取得
// while(裏画面を表画面に反映, メッセージ処理, 画面クリア)
while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 ){
DrawFormatString( x % 600, y % 480, Green, "座標[%d,%d]", x, y ); // 文字を描画する
x = x + 1; // x座標を1加算
y = y + 1; // y座標を1加算
}
DxLib_End(); // DXライブラリ終了処理
return 0;
} [/code]