음... 간단한 클래스 예제인데요... 책에는 한 파일로 되어 있답니다.
물론 한 파일에 넣고 컴파일 하면 잘 컴파일 되며 실행도 되죠...
제가 나름 대로 분할 해봤는데 에러가 엄청 뜨네요 제가 잘못한 부분이 있나요
bcc55 를 통해서 컴파일 했슴다.
---------- compile ----------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
D:\_cal_Main.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'calculator::Init()' referenced from D:\_CAL_MAIN.OBJ
Error: Unresolved external 'calculator::Add(const int&, const int&)' referenced from D:\_CAL_MAIN.OBJ
Error: Unresolved external 'calculator::Min(const int&, const int&)' referenced from D:\_CAL_MAIN.OBJ
Error: Unresolved external 'calculator::Div(const int&, const int&)' referenced from D:\_CAL_MAIN.OBJ
Error: Unresolved external 'calculator::ShowOpCount()' referenced from D:\_CAL_MAIN.OBJ
Normal Termination
출력 완료 (0초 경과).
다음은 _calculator.h 를 컴파일 한경우...
---------- compile ----------
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
D:\_calculator.h:
Fatal F1003 C:\Borland\BCC55\include\stdcomp.h 5: Error directive: Must use C++ for STDCOMP.H
*** 1 errors in Compile ***
Normal Termination
출력 완료 (0초 경과).
음... 어떻게 해결해야 하는지. 분할시 주의 해야 할점은 뭔가요?
좋은 하루 되세요.
|