C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[24478] 빌더6 버전에서 cmath 를 include 하면 stl 버전의 헤더가 포함되지 않나요?
김성철.마법사 [douner] 973 읽음    2003-02-25 18:52
STL 책을 보면서 예제를 치다가

cmath 를 include 했는데

#include <cmath>

transform(radians.begin(), radians.end(), sines.begin(), sin);

위 함수에서  sin 함수를 인자로 넘길 수 없다고 컴파일 에러가 나오더군요

그래서 살펴봤더니

cmath 의 내용이 아래처럼 되어 있었습니다

#define  __USING_CNAME__
#include <math.h>
#undef   __USING_CNAME__

그런데 다른 stl 헤더들은 다음과 같이 되어 있더군요

#ifdef _USE_OLD_RW_STL
# include <oldstl\iostream.h>
#else
# include <stlport\iostream>
/* Define __STD_IOSTREAM__ here to cause sysclass.h to define
   VCL_IOSTREAM which causes certian iostream operators to get defined
*/
#define __STD_IOSTREAM__
#endif

#if !defined(__USING_STD_NAMES__) && defined(__cplusplus)
using namespace std;
#endif /* __USING_STD_NAMES__ */


그래서 위처럼 고쳐주었더니

#ifdef _USE_OLD_RW_STL
# include <oldstl\cmath.h>
#else
# include <stlport\cmath>
#endif

#if !defined(__USING_STD_NAMES__) && defined(__cplusplus)
using namespace std;
#endif /* __USING_STD_NAMES__ */

에러가 나지 않고 잘 되네요...

헤더를 고친게 잘한 짓인지 궁금해서 질문드립니다.. -_-;;

+ -

관련 글 리스트
24478 빌더6 버전에서 cmath 를 include 하면 stl 버전의 헤더가 포함되지 않나요? 김성철.마법사 973 2003/02/25
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.