본문 바로가기

Programming/C & C++43

error LNK2005: xxxx 이(가) msvcprtd.lib(MSVCP80D.dll)에 이미 정의되어 있습니다. 각 프로젝트 별로 "런타임 라이브러리" 형식을 모두 맞춰야 한다. 한가지라도 틀리게 되면 연관된 모든 라이브러리가 링킹 에러를 내뱉게 된다. Visual C++ : 솔루션 탐색기에서 프로젝트 선택 -> 마우스 우클릭 후 '속성' -> 구성 속성 -> C/C++ -> 코드생성 -> 런타임 라이브러리 의 값을 하나의 값으로 모두 통일함( 다중스레드 디버그(/MTd) 나 다중쓰레드 디버그DLL(/MDd) ) Error Pattern 오류404error LNK2005: "public: bool __cdecl std::ios_base::fail(void)const " (?fail@ios_base@std@@QEBA_NXZ)이(가) msvcprtd.lib(MSVCP80D.dll)에 이미 정의되어 있습니다. 오류405.. 2012. 8. 25.
template 형 typedef class 를 작성할때 내부에서 자주 쓰는 긴 이름을 가진 자료형은 typedef로 alias 를 걸게 되는데 template class일 경우 typedef 내부에도 템플릿 인자를 써야하는 상황이 온다. 그러나 typedef 내부 인자로는 아래와 같은 template 을 허용하지 않으니... // compilation error template typedef std::map tmp_typedef_t; tmp_typedef_t tmp_typedef_obj; 아래와 같은 우회적인(템플릿 라이브러리들 간에 거의 표준으로 사용하는 코드라고 한다.) 사용된다. template struct tmp_typedef_t { typedef std::map Type; }; tmp_typedef_t::Type tmp_typ.. 2011. 4. 20.
function pointer Declaration & Initialization return-type (*function-pointer-name)(param1-type, param2-type, ...) = XXX (ex1) General : int (*fp)(double, double) = 0x00; (ex2) Class Member function : int (TmpClass::* fp2)(double, double) = 0x00; (ex3) Class const Member function : int (TmpClass::* fp3)(double, double) const = 0x00; 2011. 2. 15.
C++ Inheritance (public, protected, private) public inheritance : Maintains original type of super class. protected and private inheritance : Changes all types of super class to its inheritance type. public type in super class protected type in super class private type in super class public inheritance public type protected type private type protected inheritance protected type protected type protected type private inheritance private type.. 2011. 1. 20.