설명
기고자: Lutz Westermann, 2012년 10월
소형 모델 유형 :C 및 CPP
카테고리 : 메가 슬롯 API 라이브러리
메인 파일 : CPPex1.gms
$title 'C++에서 GDX를 읽고 쓰기 위한 전문가 수준 C API 테스트' (CPPEX1,SEQ=5)
$onText
기고자: Lutz Westermann, 2012년 10월
$offText
$set srcRoot %메가 슬롯sysdir%apifiles%system.dirsep%C++%system.dirsep%
$set srcRootC %메가 슬롯sysdir%apifiles%system.dirsep%C%system.dirsep%
$set exaDir %srcRoot%xp_example1%system.dirsep%
$ifThen %system.filesys% == UNIX
$ 설정되지 않은 경우 COMPILER $set COMPILER GNU
$else
$ 설정되지 않은 경우 COMPILER $set COMPILER INTEL
$endIf
$ifThen %COMPILER% == GNU
$ 세트 CPPCOMP g++
$ ifThen %system.filesys% == UNIX
$ OUT 설정 -oxp_example1
$ 플래그 설정 -ldl -lpthread
$ 다른
$ OUT 설정 -oxp_example1.exe
$ 플래그 설정
$ endIf
$elseIf %COMPILER% == INTEL
$ 세트 CPPCOMP cl
$ 플래그 설정
$ OUT 설정 -Fexp_example1.exe
$else
$ 중단 알 수 없는 컴파일러: %COMPILER%
$endIf
$call rm -rf Demanddata.gdx
$call.checkErrorLevel cp "%srcRootC%api%system.dirsep%gdxcc.c" .
$call.checkErrorLevel cp "%exaDir%xp_example1.cpp" .
$call %CPPCOMP% xp_example1.cpp gdxcc.c -I"%srcRoot%api" -I"%srcRootC%api" %OUT% %FLAGS%
$if errorlevel 1 $abort 'xp_example1.cpp 컴파일 문제'
$if %system.buildcode% == DEG $call install_name_tool -change $GCCLIBDIR/libstdc++.6.dylib "%메가 슬롯sysdir%/libstdc++.6.dylib" -change $GCCLIBDIR/libgcc_s.1.dylib "%메가 슬롯sysdir%/libgcc_s.1.dylib" xp_example1
$if %system.buildcode% == DEG $if errorlevel 1 $abort '라이브러리 경로 조정 문제'
$call .%system.dirsep%xp_example1 "%메가 슬롯sysdir%."
$if errorlevel 1 $abort 'GDX 파일을 쓰는 xp_example1 실행 중 문제 발생'
$call gdxdiffdemanddata.gdxdemandwant.gdx
$if errorlevel 1 $abort '수요 데이터가 예상과 다릅니다.'
$call .%system.dirsep%xp_example1 "%메가 슬롯sysdir%." trnsport.gdx
$if errorlevel 1 $abort 'GDX 파일을 읽는 xp_example1 실행 문제'