3

I'm working in visual studio 2010 and I have code written in C.

If i run in 'Debug' mode, the code will run without any error or warning.

But if I run the same in 'Release' mode, errors and warning will appear.

Error List:

        warning C4013:'fprintf' undefined; assuming extern returning int
        error C2065: 'stdout': undeclared identifier

What is the reason? please help

cnicutar
  • 178,505
  • 25
  • 365
  • 392
SHRI
  • 2,406
  • 6
  • 32
  • 48

2 Answers2

2
warning C4013:'fprintf' undefined; assuming extern returning int

It looks like you didn't include stdio.h.

cnicutar
  • 178,505
  • 25
  • 365
  • 392
1

Seems like a difference in configuration between Release and Debug. Check the values for "Whole Program Optimization", they may differ between the two build configurations.


I had the same problem in reverse: In Release mode everything was fine, but in Debug mode some functions like 'ext' (FFTW library) were reported as "undefined; assuming extern returning int".

The failing build configuration (Release in my case) had under project properties Configuration Properties > General the option "Whole Program Optimization" set to No Whole Program Optimization.

The successful build configuration had this set to Use Link Time Code Generation. When I set that option in my failing target as well, everything worked fine.

Diana
  • 789
  • 8
  • 34