IT 취미생활.  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
'Programming/Error Case'에 해당하는 글(13)
2009.09.18   fatal error C1902: Program database manager mismatch; please check your installation
2009.09.18   /Za, /Ze(언어 확장 사용 안 함)
2009.07.21   warning: dereferencing type-punned pointer will break strict-aliasing rules
2009.07.01   [warning]suggest parentheses around assignment used as truth value
2008.12.12   error C2787: 'IContextMenu' : no GUID has been associated with this object
2008.11.13   warning C4013: 'xxxxxxxxxxxx' undefined; assuming extern returning int
2008.08.04   [Error Case - Wince5.0]fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86' 2
2008.08.04   [Error Case - Wince5.0] C4430
2008.07.11   [MFC] Custom Control 사용시 주의 할 점
2008.07.11   Compiler Error C2099
2008.07.07   [DshowFilter] Wince5.0을 최초 설치 후 Filter 관련 Project를 Build 시 발생하는 Error


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

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

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

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

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




/Za, /Ze(언어 확장 사용 안 함)


/Ze 옵션은 Visual C++ 2005에서 사용되지 않습니다. 자세한 내용은 Visual C++ 2005의 사용되지 않는 컴파일러 옵션을 참조하십시오.

아래 링크를 참조 하시면 됩니다.

http://msdn.microsoft.com/ko-kr/library/0k0w269d.aspx



warning: dereferencing type-punned pointer will break strict-aliasing rules

Wall로 Build 를 하는데 아래와 같은 워닝이 발생해서

warning: dereferencing type-punned pointer will break strict-aliasing rules

구글링좀 하고, 고치기 귀찮아서  MakeFile만 수정해서 올림
연구원 씨가 관심 있으면 고치겠지.....



The following short examples demonstrate my problem:

----Exhibit A
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int foo;
    int bar;
} item_t;

int return_item (void **item);

int return_item (void **item)
{
    void *mem;

    mem = malloc (1);
    if (mem) {
        *item = mem;
        return 0;
    }
    else
        return 1;
}

int main (int argc, char *argv[])
{
    item_t *item;

    if (return_item ((void **)&item) == 0) {
        printf ("%p\n", item);
        free (item);
    }

    return 0;
}

----Exhibit B
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int foo;
    int bar;
} item_t;

int return_item (void **item);

int return_item (void **item)
{
    void *mem;

    mem = malloc (1);
    if (mem) {
        *item = mem;
        return 0;
    }
    else
        return 1;
}

int main (int argc, char *argv[])
{
    item_t *item;
    void *item_temp;

    if (return_item (&item_temp) == 0) {
        item = item_temp;
        printf ("%p\n", item);
        free (item);
    }

    return 0;
}
----

The code is a generic example of the problem.  The real code that is
producing the problem is a hashing API which hashes (void *) and hence
uses (void **) as an out parameter type. 

Exhibit A produces a warning as follows:

[nodbug:mato]$ gcc -O2 -Wall -o aliasing-test aliasing-test.c
aliasing-test.c: In function `main':
aliasing-test.c:28: warning: dereferencing type-punned pointer will break strict-aliasing rules

I'm using gcc version 3.3.5 (Debian 1:3.3.5-13) but the problem persists
even when tested with GCC 4.x on newer systems.

Exhibit B is my proposed "fix".  Can anyone advise if the code in
Exhibit A is legitimate, i.e. whether or not it's really violating the
strict aliasing rules as defined by the C standard?  If not, then I
guess the warning is spurious and I can safely use the fix.

If the code is in fact violating the standard then feel free to
enlighten me how to fix it, since it seems like a legitimate thing to do
:-)

Thanks very much for any help,
귀차나서 그대로 긁어 왔습니다.

참고 : http://gcc.gnu.org/ml/gcc-help/2006-08/msg00236.html


음 문제가 되면 삭제 하겠습니다 훗..



[warning]suggest parentheses around assignment used as truth value

워닝 발생

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

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

KIN.....



error C2787: 'IContextMenu' : no GUID has been associated with this object
아래와 같은 문제로 인해서 문제가 발생 됩니다.
문제 해결 방법은 2가지가 있습니다.


1. 원론적 문제 해결 방법

------------------------------------------------------------------------------
>I am building a shell extn. project in .net ide which is
>converted from vC++ 6.00.
>
>During buid i am getting the following error
>"error C2787: 'IContextMenu' : no GUID has been associated
>with this object", The same project works fine in VC++6.0.
>
>I have included the following files also
>#include <shlguid.h>
>#include <shobjidl.h>
>#include <shlobj.h>
>
>any help will be appreciated

This is interesting. There are two <comdef.h> header files in VC.NET, one in
Vc7/include and the other in Vc7/PlatformSDK/include. The former splits off
the smart pointer typedefs into comdefsp.h, and it doesn't include
IContextMenu. The latter does. You can try to #include the PlatformSDK
header directly, change your INCLUDE path order, or supply the missing
typedef yourself, e.g.

struct __declspec(uuid("000214e4-0000-0000-c000-000000000046"))
IContextMenu;

_COM_SMARTPTR_TYPEDEF(IContextMenu, __uuidof(IContextMenu));

--
Doug Harrison
Microsoft MVP - Visual C++
------------------------------------------------------------------------------


2. 더 간단한 방법은...

------------------------------------------------------------------------------
The response is for people that find this thread by searching for the same error.

Just define at the top of the stdafx.h file above your includes:
#define _ATL_NO_UUIDOF
------------------------------------------------------------------------------


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]fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'
문제 :
VS2005에서 Renderer Filter Compile 시 Error 발생

 I am getting this error message while compiling a SubTitle Renderer Filter code in
VS2005 for Wince5.0 Platform.

fatal error LNK1112: module machine type 'ARM' conflicts with target machine type 'X86'


해결

You can either for compiler to target ARM.To do so Go to Properties->Linker->Advanced->Target Machine. Verify also that in properties->Configuration Type is good because  sometimes between platform switch you can have some pbs.

If you are compiling a resource DLL do not forget to set NO ENTRY POINT
in Linker->Advanced.


Wince Filter 작업을 할때 참고 하세요.


[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).


Compiler Error C2099

Error Message

initializer is not a constant

This error is issued only by the C compiler and occurs only for non-automatic variables. The compiler initializes non-automatic variables at the start of the program and the values they are initialized with must be constant.

Example

The following sample generates C2099.

// C2099.c
int j;
int *p;
j = *p; // C2099 *p is not a constant

C2099 can also occur because the compiler is not able to perform constant folding on an expression under /fp:strict because the floating point precision environment settings (see _controlfp_s for more information) may differ from compile to run time.

When constant folding fails, the compiler invokes dynamic initialization, which is not allowed in C.

To resolve this error, compile the module as a .cpp file or simplify the expression.

For more information, see /fp (Specify Floating-Point Behavior).

The following sample generates C2099.

// C2099_2.c
// compile with: /fp:strict /c
float X = 2.0 - 1.0;   // C2099
float X2 = 1.0;   // OK


Also See - C/C++ Build Errors

http://msdn.microsoft.com/en-us/library/8x5x43k7(VS.80).aspx



[DshowFilter] Wince5.0을 최초 설치 후 Filter 관련 Project를 Build 시 발생하는 Error
C:\WINCE500\PUBLIC\DIRECTX\SDK\INC\ctlutil.h(289) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


F4를 눌러서 에러가 나는 부분으로 뛰면
ctlutil.h 파일 228 Line에서 Error 발생
오리지널
private:
    //  Prevent bugs from constructing from LONG (which gets
    //  converted to double and then multiplied by 10000000
    COARefTime(LONG);
    operator=(LONG);   //  <------ Check Here
};

변경
private:
    //  Prevent bugs from constructing from LONG (which gets
    //  converted to double and then multiplied by 10000000
    COARefTime(LONG);
    LONG operator=(LONG);   //  <------ Check Here
};



일단 에러를 회피 하자.!


BLOG main image
취미생활
 Notice
 Category
분류 전체보기 (191)
매일매일갱생 (83)
서버개발 (1)
임베디드개발 (12)
Programming (80)
개발잡념 (10)
C (6)
C++ (5)
Java (4)
알고리즘 (5)
VC++ (11)
DirectShow (5)
OS (1)
Error Case (13)
Personal Projects (6)
유용한 프로그램 (0)
 TAGS
Linux spam mail 미라지폰 C++ english email isdbt Wince5.0 Debug debugging 출장 티스토리초대 DirectShow 알고리즘 Algorithm project It Java 티스토리 초대장 Error Case 벨소리 변경 MP3 VC++ English Dshow warning Windows Mobile6.0 군대 ISDB-T 1seg C 영어 이메일 DVB Brazil 음식 서태지 퇴사 M480 DVB-T 개발자
 Calendar
«   2024/04   »
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
 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