Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning (Level 1) C4744

Error Message

'var' has different type in 'file1' and 'file2': 'type1' and 'type2'

An external variable referenced or defined in two files has different types in those files. To resolve, either make the type definitions the same, or change variable name in one of the files.

C4744 is emitted only when files are compiled with /GL. For more information, see /GL (Whole Program Optimization).


C4744 usually occurs in C (not C++) files, because in C++ a variable name is decorated with type information. When the sample (below) is compiles as C++, you’ll get linker error LNK2019.


This sample contains the first definition.

// C4744.c
// compile with: /c /GL
int global;

The following sample generates C4744.

// C4744b.c
// compile with: C4744.c /GL /W1
// C4744 expected
#include <stdio.h>

extern unsigned global;

    printf_s("%d\n", global);

Community Additions

© 2015 Microsoft