Borland C++ v5.5 - Compile & Link Command Line
2010.06.29 22:05
레조 Edit

1. 컴파일러 설치
* 2000.04월 이전에 다운받은 Borland C++ 5.5 컴파일러는 Service Pack 1 / 2를 적용한다.
* 2000.08.24일 이전에 다운받은 Borland C++ 5.5 컴파일러는 Service Pack 2를 적용한다.
* 아래에 소개한 곳에서 지금 받는 Borland C++ 5.5 컴파일러는 패치가 필요없다.
[받는곳]
http://www.codeself.com/index.php?page=1105&action=read&tupleno=1
http://www.borlandforum.com/impboard/impboard.dll?action=read&db=cpp_res&no=3
2. 컴파일러 세팅
(path는 컴파일러 설치한 곳을 기준으로 각자 맞추기바랍니다.)
컴파일러 설치후 bin 폴더 내부에 아래의 2개 파일을 만든다.
[ bcc32.cfg ]
-I”C:\Borland\Bcc55\include”
-L”C:\Borland\Bcc55\lib;C:\Borland\Bcc55\lib\psdk”
/* 만일 Windows 2000 이전 시스템(NT4, Win95/98)과 호환성을 유지하려면 아래의 2라인을 더 추가합니다. (띄어쓰지말기)*/
-DWINVER=0x0400
-D_WIN32_WINNT=0x0400
[ ilink32.cfg ]
-L”C:\Borland\Bcc55\lib;C:\Borland\Bcc55\lib\psdk”
3. Path 설정
다른 컴파일러 제품이 이미 설치되어 있어서 시스템 Path 수정이 곤란할 경우 기본 Path가 지정되어 있는
폴더에 SETBCC55ENV.bat와 같은 배치 파일을 만들어 각각의 Command prompt에 적용하여 컴파일러를 사용한다.
[ setbcc55env.bat ]
SET PATH = C:\Borland\Bcc55\Bin;
자신이 필요한 만큼 선언한다.
예) setbcc55.bat
@echo off
SET PATH=C:\Borland\Bcc55\Bin;C:\WINNT;C:\WINNT\System32;C:\Program Files\Internet Explorer
H:
cd lezo\CommandLine\Test
4. 컴파일 하기
[ 콘솔 컴파일 ]
bcc32 –tC –c hello.cpp
-tC : 정적 C RTL을 연결하는 콘솔 모드 컴파일 옵션 (기본값)
(console mode executable linked with the static C RTL (default switch))
-tCR : 임포트 C RTL DLL을 연결하는 콘솔 모드 컴파일 옵션
(console mode executable linked with the import library for the C RTL DLL (cw3250.dll))
-tCM : 멀티 쓰레드 지원 옵션 (ex> bcc32 –tC –tCM –c hello.cpp )
(link with multi-thread support)
[ 콘솔 링크 ]
ilink32 objfiles, exefile, mapfile, libfiles, deffile, resfiles
* exefile, mapfile, deffile, resfiles 는 생략할 수 있다.
* exefile을 생략하면 objfiles에서 첫번째 obj의 이름을 따르는 exe 파일이 생성된다.
컴파일 옵션에 따라 아래의 3가지 경우로 자주 사용된다.
-tC –c 컴파일 옵션일 경우
ilink32 c0x32.obj hello.obj, hello.exe, , import32.lib cw32.lib
-tCR –c 컴파일 옵션일 경우
ilink32 c0x32.obj hello.obj, hello.exe, , import32 cw32i
-tCM –c 컴파일러 옵션일 경우
ilink32 c0x32.obj hello.obj, hello.exe, , import32.lib cw32mt.lib
[ win32 컴파일 ]
bcc32 –tW –c helloGUI.cpp
-tW : 정적 C RTL을 연결하는 윈도우 모드 컴파일 옵션 (기본값)
(windowed executable linked with the static C RTL (default switch)
-tWR : 임포트 C RTL DLL을 연결하는 윈도우 모드 컴파일 옵션
(windowed executable linked with the import library for the C RTL DLL (cw3250.dll))
-tWM : 멀티 쓰레드 지원 옵션 (ex> bcc32 –tW –tWM –c helloGUI.cpp )
(link with multi-thread support)
[ win32 링크 ]
컴파일 옵션에 따라 아래의 3가지 경우로 자주 사용된다.
-aa : winmain 시작시 콘솔창을 띄우지 않는다.
-tW –c 컴파일 옵션일 경우
ilink32 -aa c0w32.obj helloGUI.obj, helloGUI.exe, , import32 cw32
-tWR –c 컴파일 옵션일 경우
ilink32 -aa c0w32.obj helloGUI.obj, helloGUI.exe, , import32 cw32i
-tWM –c 컴파일러 옵션일 경우
ilink32 -aa c0w32.obj helloGUI.obj, helloGUI.exe, , import32.lib cw32mt.lib
[출처]
http://www.codeself.com/index.php?page=1104&action=read&tupleno=3
http://turboc.borlandforum.com/impboard/impboard.dll?action=read&db=cpp_tutorial&no=6
이 글과 관련된 글
- [2010/07/06] Borland C++ v5.5 - MAKE (219)
- [2010/07/05] Borland C++ v5.5 - LIB & DLL (197)
- [2010/07/01] Borland C++ v5.5 - Resource (222)
- [2010/06/14] Special Issue on C++Builder 2010 (BCBJ) (545)
- [2008/10/30] 연산자와 예약어 - C 프로그래밍은 산수다 III (0)
CODESELF 커뮤니티(