IT 취미생활.  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
'Error Case'에 해당하는 글(7)
2009.09.18   fatal error C1902: Program database manager mismatch; please check your installation
2009.07.01   [warning]suggest parentheses around assignment used as truth value
2008.11.13   warning C4013: 'xxxxxxxxxxxx' undefined; assuming extern returning int
2008.08.04   [Error Case - Wince5.0] C4430
2008.07.11   [MFC] Custom Control 사용시 주의 할 점
2008.06.27   "msvcrtd.lib" 링크시 문제
2008.03.11   [Dshow] DirectShow Filter Build시 발생하는 Link Error 해결방법


fatal error C1902: Program database manager mismatch; please check your installation

2003 .net으로 빌드 환경이 된 make를 vs 2005로 변환하는

삽질중에  mspdb80.dll(windows/system에 잡아 넣음)로 인하여 발생한 컴파일 에러 메시지

Big 삽질을 할뻔 했는데 다행이 관련 문제에 대해서

경험 해보신 분이 있어서 3분만에 삽질 마무리...




[warning]suggest parentheses around assignment used as truth value

워닝 발생

if ( x = getSomethingValue())
{
 ........
}

해결방법
if ( (x = getSomethingValue()) )
{
 ........
}

KIN.....



warning C4013: 'xxxxxxxxxxxx' undefined; assuming extern returning int
warning C4013: 'xxxxxxxxxxxx' undefined; assuming extern returning int


Error Case 는 아니지만  Warning이 기분이 나빠서 찾아봤습니다.
왜 그럴까?

개발하고 있는 project는 방송용  Middleware로   팀에서 개발할 정도의
규모입니다. 최근 renewal을 하고 있는터라 이것 저것 정리 하다 보니

Header파일이 빠져 있어서 발생한 문제였습니다.
함수는 내부적으로  extern 키워드로 선언이 된 녀석들이라서
실제  Error는 나지 않았습니다.

Header 를 include 시켜주니 문제가 사라졌습니다.


[Error Case - Wince5.0] C4430

오늘도 Builder로 써 열심히 Build를 하고 있었다...
나 <--- 난 거의 팀내 잡부로 수 많은 Link Error를 접해보는 사람이다.

아래와 같은 C4430을 마주했다.

1>.\SubtitlePresentation.cpp(109) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Class에서 Member Function을 선언하고, 실제 구현부에서 return 값을 빼먹었을때,
C4430이 여지 없이 일어난다 한번 테스트를 해보길...





MSDN Error 페이지를 살펴 보니 아래와 같은 경우 발생하게 된다.

Error Message

missing type specifier - int assumed. Note: C++ does not support default-int

This error can be generated as a result of compiler conformance work that was done for Visual C++ 2005: all declarations must now explicitly specify the type; int is no longer assumed. See Breaking Changes in the Visual C++ 2005 Compiler for more information.

C4430 is always issued as an error. You can turn off this warning with the #pragma warning or /wd; see warning or /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Warning Level) for more information.

Example

The following sample generates C4430.

  Copy Code
// C4430.cpp
// compile with: /c
struct CMyClass {
   CUndeclared m_myClass;  // C4430
   int m_myClass;  // OK
};

typedef struct {
   POINT();   // C4430
   // try the following line instead
   // int POINT();
   unsigned x;
   unsigned y;
} POINT;



[MFC] Custom Control 사용시 주의 할 점
문제 해결....

해당 Custom Control을 이용시 해당 Class 이름을 연결 해주어야 합니다.
이것을 몰랐네요 ㅜ0ㅜ


봉착 했던 문제
단순히 Resource View에 Custom Control을 추가 하고 프로그램을 실행 하는
것만으로도 아래와 같은 Output을 내보내며 프로그램이 실행 조차도 안된다.


실제 디버깅을 하여 따라가보면
OnInitialD~ () 들어 오지 않는다 헐...
왜 그럴까????

한참 고민하고 비스타 문제인가? 생각되어 회사 선배의 노트북에서
체크(vs 2008)를 해봤으나 역시 마찬가지 아래와 같은 메시지 뿐....

XP에서도 마찬가지였다.
오랜만에 찾은 데브피아 ~ !!
럭키 문제는 Custom Control을 사용할때 해당 Class 명을  연결 해줘야 한다는 것이다.

내가 UI 프로그래밍이 많이 약한 것을 잘 알고 있다.
ㅜ..ㅜ 너무 싫은게 아니라 모르는게 많은 것이다.
매일 매일 갱생이 필요 할 듯 하다.



Detected memory leaks!
Dumping objects ->
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\occmgr.cpp(195) : {71} normal block at 0x01718248, 8 bytes long.
 Data: <        > E9 03 00 00 00 00 00 00
{70} normal block at 0x01718200, 8 bytes long.
 Data: <        > FF FF FF FF 00 00 00 00
Object dump complete.
The program '[3568] MultiListApplication.exe: Native' has exited with code 0 (0x0).


"msvcrtd.lib" 링크시 문제
LNK4098: defaultlib "msvcrtd.lib" conflicts ... 학습중(Windows)

C Run-Time Library는 standard library를 말합니다.

printf, strcpy, malloc, new, cin, cout 등등이  이 라이브러리에 포함됩니다.


종류는 꽤 많은데, 별로 복잡하지는 않습니다.

libc.lib : c언어에 해당하는 라이브러리 입니다. printf, strcpy, malloc 등이 구현되어 있습니다.

libcmt.lib : libc 와 동일합니다만, 이것은 멀티쓰레드 용입니다.

msvcrt.lib : libc 와 동일합니다만, 이것은 dll 용입니다.

               ( 위의 두가지는 static link 로 사용되고, 이것은 dynamic link 로 사용됩니다.)



libcp.lib : c++언어에 해당하는 라이브러리 입니다. cin,  cout, new  등이 구현되어 있습니다.

libcpmt.lib : libcp 와 동일합니다만, 이것은 멀티쓰레드 용입니다.

msvcprt.lib : libcp 와 동일합니다만, 이것은 dll 용입니다.

               ( 위의 두가지는 static link 로 사용되고, 이것은 dynamic link 로 사용됩니다.)



그러므로, 위의 라이브러리는 두개의 그룹중에 하나씩만 포함이 되어야 합니다.

만약, libc 와 msvcrt 가 둘다 링크되면 중복선언 되었다는 에러가 납니다.


하지만, 다른 프로젝트에서 가지고 왔다면, 이러한 링크옵션 수정하는 것이 쉽지 않을 수 있습니다.

프로젝트 구조를 보아야 알 수 있으나, 한가지 해결방법은....


링크에서 메세지에도 나와 있듯이, 링크 옵션에 다음을 추가 하십시오.

/NODEFAULTLIB:library

 

library 에 포함시키지 말아야 할 라이브러리를 추가하시면, 이 라이브러리는 링크에 포함되지 않습니다.

 

그러면, 중복 선언 에러는 해결 할 수 있습니다.



 출처 : Devpia / VC++ / 질문답변 / 572567

작성자 : 김무석(kim790815) 님



[Dshow] DirectShow Filter Build시 발생하는 Link Error 해결방법
Some of the DirectShow samples break if you install Visual Studio 2005 Beta 2. Most of the errors that I found fall into three categories:
  • C4430: Missing type specifier. To conform with C++, undeclared types do not default to int. All types must be declared. Fix: Declare the type, or suppress the warning with the "/wd4430" flag.
  • C4996: ' xxxx' was declared deprecated. You may be including an older version of strsafe.h from the DirectX SDK or the Platform SDK. You should include the version installed with Visual Studio. (But it's probably harmless to ignore this warning.) 
  • C2065: 'xxx': undeclared identifier. To conform with C++, the scope of a variable declared inside a "for" loop is restricted to the loop. Fixes: (a) Move the declaration outside the for loop. (b) Redeclare the variable in multiple scopes, if you don't need it to persist outside the loop. (c) Set the /Zc:forScope flag. (You can find this under Project, Properties, Configuration Properties, C/C++, Language, Force Conformance In For Loop Scope. Set to "No".)

Here are the specific fixes that I made. Warning: I have not thoroughly tested these, and I only tried them under the "Windows XP 32-bit Debug" environment in Platform SDK. You should use your own judgment before making any of these fixes.

  • BaseClasses\ctlutil.h (278)  
       (LONG) operator=(LONG);
  • BaseClasses\wxdebug.cpp (564)
        static DWORD g_dwLastRefresh = 0;
  • BaseClasses\winutil.cpp (2092)
       UINT Count;
       for (Count = 0;Count < Result;Count++) {
  •  BaseClasses\outputq.cpp (635)
       long iDone = 0;
       for (iDone = 0;
  • Capture\AmCap\amcap.cpp (691)
        for(int i = 0; i < NUMELMS(gcap.rgpmAudioMenu); i++)
  • Capture\AmCap\amcap (2795)
        for(int i = 0; i < NUMELMS(gcap.rgpmAudioMenu); i++)
  • DMODemo\dsutil.cpp (686)
        DWORD i = 0;
        for( i=0; i<m_dwNumBuffers; i++ )
  • dmoimpl.h (622)   [In the Platform SDK headers]
        for (DWORD dw = 0; dw < NUMBEROFOUTPUTS; dw++) {
  • DMO\GargleDMO\MedParamBase\param.cpp (91)
        for (DWORD dwIndex = 0; dwIndex < cParams; dwIndex++)
  • DMO\GargleDMO\MedParamBase\param.cpp (309)
        CCurveItem *pCurve = NULL;
        for (pCurve = pCurveHead;
  • DMO\GargleDMO\gargle.cpp (145)
        for (DWORD i = 0; i < cOutputStreams && SUCCEEDED(hr); ++i)
  • Filters\Dump\dump.cpp (426)
        for (int Loop = 0;Loop < (DataLength % BYTES_PER_LINE);Loop++)
  • Filters\Gargle\gargle.cpp (212)
        static int m_nInstanceCount; // total instances
  • Filters\RGBFilters\RateSource\ratesource.cpp (382)
        for( int y = 0 ; y < DEFAULT_HEIGHT ; y++ )
  • Filters\RGBFilters\RateSource\ratesource.cpp (387)
        for( int y = 0 ; y < DEFAULT_WIDTH ; y++ )
  • VMR\VMRXclBasic and VMR\Ticker: LNK1181: cannot open input file 'dxguid.lib'. This was an error in the makefile. Change to read:
        DXLIB="$(DXSDK_DIR)\Lib\x86"  (currently says "x32")
  • VMR\VMRXcl and VMR\VMRMulti: C1083: Cannot open include file: 'd3dxmath.h': No such file or directory. This is an old DX header that is no longer included in DX or in Visual Studio. Unfortunately the only fix is to download an older version of the DirectX SDK.
  • VMR9\MultiVMR9\GamePlayer\character.cpp (383)
        DWORD i = 0;
        for (i = 0; i < pMeshContainer->NumInfl; ++i)
  • VMR9\MultiVMR9\DLL\MixerControl.h (28)
        static const DWORD MultiVMR9Mixer_DefaultFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1;
  • VMR9\VMRAllocator: error LNK2019: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (etc).  Add this to the makefile:

        comsuppw.lib \



BLOG main image
취미생활
 Notice
 Category
분류 전체보기 (191)
매일매일갱생 (83)
서버개발 (1)
임베디드개발 (12)
Programming (80)
Personal Projects (6)
유용한 프로그램 (0)
 TAGS
티스토리 초대장 개발자 English english email 서태지 알고리즘 Linux DVB C 군대 Windows Mobile6.0 M480 Wince5.0 It Algorithm 퇴사 티스토리초대 Dshow Java warning debugging 벨소리 변경 ISDB-T spam mail project 미라지폰 1seg DirectShow DVB-T 출장 Error Case VC++ 영어 이메일 Brazil MP3 C++ Debug 음식 isdbt
 Calendar
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
 Recent Entries
 Recent Comments
 Recent Trackbacks
 Archive
 Link Site
zextor
괴짜 프로그래머의 일상사~@@
Gag & Peace, and more..
Kazakhstan Almaty.......
Min-A
Sadgarret
Steve Yoon's log
가슴 뛰는 삶을 살아라
오스틴 파워
GUI sin
melanie parker_Lady
제레미의 TV 2.0 이야기..
 Visitor Statistics
Total :
Today :
Yesterday :
rss