1

Topic: In what a difference between modes debug and release?

Situation such: there is ancient enough project on VS 2008, and I should support it. Faced such problem:
If I collect in studio in a mode debug all gathers normally if I collect in a mode release the compiler does not find one of heading files, stablly same file.
In what the basic difference between these modes? In what there can be a business?

2

Re: In what a difference between modes debug and release?

In respect of a preprocessor - certain macro NDEBUG. Why to you not
To look on  in a place where not being title turnes on?.

3

Re: In what a difference between modes debug and release?

Abejon wrote:

the Situation such: there is ancient enough project on VS 2008, and I should support it. Faced such problem:
If I collect in studio in a mode debug all gathers normally if I collect in a mode release the compiler does not find one of heading files, stablly same file.
In what the basic difference between these modes? In what there can be a business?

In essence Debug-assemblage is intended for application debugging, Debug - assemblage is not application, and a certain bench on which you can debug algorithms and catch errors.
Release-assemblage is intended for application operation.
(I offer you attentively to read each word and to ponder)
If you cannot collect application in Relese, it, as a matter of fact, you cannot collect it GENERALLY.
Further, if you publish details, probably, to you help.
P.S. Yes, forgot to add, this piece is ONLY at Microsoft VC.

4

Re: In what a difference between modes debug and release?

MasterZiv wrote:

P.S. Yes, forgot to add, this piece is ONLY at Microsoft VC.

Yes is not present, this piece is everywhere.

5

Re: In what a difference between modes debug and release?

Abejon;
If in one configuration gathers, and in the second is not present: we come into adjustments, and we look, than one configuration differs from another. In this case, in  ++, the General, Additional directories of included files, there it is necessary to add a C

6

Re: In what a difference between modes debug and release?

Dimitry Sibiryakov;
Here a file where what cannot open the compiler is connected:

//
//stdafx.h
//Client
//Common module
//
#pragma once
#ifndef _HAS_TR1
#define _HAS_TR1 1
#endif
#include <memory>
using namespace std:: tr1;
#if! defined (AFX_STDAFX_H__1CCC2E75_F59B_4A7B_8F1E_8E89DF186C6B__INCLUDED_)
#define AFX_STDAFX_H__1CCC2E75_F59B_4A7B_8F1E_8E89DF186C6B__INCLUDED_
#if _MSC_VER> 1000
#pragma once
#endif//_MSC_VER> 1000
//ATL secured functions.
#define _SECURE_ATL 1
//STL errors handling.
//_SECURE_SCL=1 for enabled state, 0 for disabled.
//_SECURE_SCL_THROWS=1 for throwing exception, 0 for abnormal program termination.
#ifdef _SECURE_SCL
#undef _SECURE_SCL
#endif
#ifdef _SECURE_SCL_THROWS
#undef _SECURE_SCL_THROWS
#endif
#define _SECURE_SCL 1
#define _SECURE_SCL_THROWS 1
//Insert your headers here
#define WIN32_LEAN_AND_MEAN //Exclude rarely-used stuff from Windows headers
#define _NORMAL_ (0x00)
#define _OFFLINE_ (0x01)
#define _STANDBY_ (0x02)
#define _DISABLE_ (0x04)
#define _DISABLE_NEW_ (0x08)
#define _MESSAGES_UNREAD_ (0x10)
#ifndef release_try
#ifdef DEBUG
#define release_try {
#define release_end_try}
#define release_catch_all} if (0) {
#define release_catch_end}
#define release_catch_tolog (...)}
#define release_catch_expr_and_tolog (...)}
#define delete_catch (x) delete x;//use debug and/or brain!
#else
#define release_try try {
#define release_end_try} catch (...) {}
#define release_catch_all} catch (...) {
#define release_catch_end}
#define release_catch_tolog (...)} catch (...) {appendToErrorFile (__ VA_ARGS __);}
#define release_catch_expr_and_tolog (x...)} catch (...) {x; appendToErrorFile (__ VA_ARGS __);}
#define delete_catch (x) try {delete x;} catch (...) {}//ha-ha-ha! we need to avoid stupid crashes.
#endif
#endif
#define _WTL_NO_CSTRING
#include <atlstr.h>
#include <windows.h>
#include <wininet.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <iads.h>
#include <Adshlp.h>
#include <sstream>
#pragma warning (push)
#pragma warning (disable:4100)
#include <ptl.h>
#include <abstract.h>
#pragma warning (pop)
#include <wtlincl.h>
#include <errors.h>
#include <process.h>
#include <atlbase.h>
#include <atlapp.h>
#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlmisc.h>
#include <atlutil.h>
using namespace PTL;
//debug info
#include "IPCTraceMacros.h"
#include "sqlite3.h"
#include "Constants.h"
#include "mvc.h"
#include "PostFunctions.h"
extern volatile LONG g_bDebugMode;
#define BEGINTHREADEX (lpsa, cbStack, lpStartAddr, lpvThreadParm, fdwCreate, lpIDThread) ((HANDLE) _beginthreadex ((void *) (lpsa), (unsigned) (cbStack), (unsigned int (__ stdcall *) (void *)) (lpStartAddr), (void *) (lpvThreadParm), (unsigned) (fdwCreate), (unsigned *) (lpIDThread)))
extern inline DWORD WaitForSingleObjectWithMsgLoop (__ in HANDLE hHandle, __ in DWORD dwMilliseconds);
#endif//! defined (AFX_STDAFX_H__1CCC2E75_F59B_4A7B_8F1E_8E89DF186C6B__INCLUDED_)

The mode DEBUG is mentioned only in determination of the macroes intended for exception handling, as far as I understand.
Instead of the file <ptl.h> , connected here in this fragment opens:

#pragma warning (push)
#pragma warning (disable:4100)
#include <ptl.h>
#include <abstract.h>
#pragma warning (pop)

Here, actually, its contents:

#pragma once
#include <windows.h>
#include ".\common\wtlincl.h"
#include ".\common\errors.h"
#include ".\common\abstract.h"
#include "penum.h"
#include "penumstub.h"
#include "pbase.h"
#include "plocale.h"
#include "pplugin.h"
#include "ptempl.h"
#include "pmenu.h"
#include "pfind.h"
#define GetItemByID GetItemByName

Configuration looked, compared. They differ in C section ++ in the following:
- In section Optimization: in a mode release optimization is included, in a mode debug - is not present;
- In section Preprocessor: in a mode release it is defined _DEBUG, in a mode debug - NDEBUG.
In this section I did not see other distinctions.

7

Re: In what a difference between modes debug and release?

maxapet wrote:

Here a file where what cannot open the compiler is connected:

//stdafx.h

And now read about stdafx.h .
Then solve - whether the compiled titles and if are necessary are necessary to you generally beforehand as it is correct with them to work.

8

Re: In what a difference between modes debug and release?

Basil A. Sidorov;
Thanks, I esteem. But on a question of the answer is not present still.  titles it is included in both modes: and debug , and in release , and they work differently.

9

Re: In what a difference between modes debug and release?

maxapet wrote:

Prekompiljaitsja of titles is included in both modes: and debug , and in release , and they work differently

... Only change of a mode demands recompilation beforehand the compiled titles.
If still it appears that "in your specific" a case pch not especially save time - it is necessary to refuse their usage simply.

10

Re: In what a difference between modes debug and release?

Basil A. Sidorov so after all recompilation happens at each change of a mode. But I pass from release in debug and all is compiled normally, I pass from debug in release and all breaks.
Probably, in my case also it is necessary to refuse from  titles - the project not such and big. But it it will be necessary to correct many files, and I am not assured that after I it will make all, at me all earns - I do not understand the reason of this error. Means, I will face it once again, and it is necessary to begin all with the beginning.
.. I will leave it as a last resort. All the same, it would be desirable to understand, in what business.

11

Re: In what a difference between modes debug and release?

maxapet, and we see the text of an error nevertheless? And that something with this weather a crystal full-sphere  is constant)

12

Re: In what a difference between modes debug and release?

White Owl wrote:

it is passed...
Yes is not present, this piece is everywhere.

Yes is not present in  library S debug version. (And with ++)
There it is possible to include or ungear any flags of checks separately.
Simply operation in the application collected MSVC in a debug mode generally is impossible.
In  all not so is segregated.

13

Re: In what a difference between modes debug and release?

maxapet wrote:

Probably, in my case also it is necessary to refuse from  titles - the project not such and big. But it it will be necessary to correct many files,

No, it is not necessary. Simply enough  usage precompiled header.
It is possible to make by the way it only for one this source file where the title does not turn on.
, the error what is produced?

14

Re: In what a difference between modes debug and release?

Basil A. Sidorov wrote:

it is passed...
And now read about stdafx.h .
Then solve - whether the compiled titles and if are necessary are necessary to you generally beforehand as it is correct with them to work.

Vasily, and in the same place the first file is a TITLE, there stdafx.h quite correctly is commented out.
It there is not necessary. So business is visible and not in it....
Now a crystal full-sphere bring up, it will be clearer...

15

Re: In what a difference between modes debug and release?

MasterZiv, It is guilty. FATAL ERROR 1083: Can not open file ' ptl.h ' Such file or directory not found

16

Re: In what a difference between modes debug and release?

MasterZiv if to be absolutely exact, an error here such:
d:\mysolution\myproject\stdafx.h (81): fatal error C1083: Cannot open include file: ' ptl.h ': No such file or directory

17

Re: In what a difference between modes debug and release?

maxapet wrote:

d:\mysolution\myproject\stdafx.h (81): fatal error C1083: Cannot open include file: ' ptl.h ': No such file or directory

it is thought that the way to ptl.h debug is registered in a configuration in Additional Include Directories, and for release - is not present. It is necessary to register it and will be ))

18

Re: In what a difference between modes debug and release?

egorych, it would be too simple, but... The way is registered in both cases truly. The order too coincides.

19

Re: In what a difference between modes debug and release?

maxapet and if hands way in stdafx.h to problem file to register that it turns out?
Still, by the way, here such here came to mind: find 7 differences between

 ptl and pt1 

20

Re: In what a difference between modes debug and release?

MasterZiv wrote:

it is passed...
Yes is not present in  library S debug version. (And with ++)

And at what here library debug versions? They certainly often happen two types, specially for the sake of debugging, but are not so mandatory.
You to debug the program gather instead of library?

MasterZiv wrote:

There it is possible to include or ungear any flags of checks separately.

As and in MSVC it only different dial-ups of flags for the assembly. Simply big IDE already from a box know that application can be collected in two modes and offers these two dial-ups of flags (which can also be changed in advanced IDE).
And even if not to use IDE generally nobody hinders to have  checked by your favourite scenary system and including this or that dial-up of flags, ways and libraries.

21

Re: In what a difference between modes debug and release?

MasterZiv wrote:

Vasily, and in the same place the first file is a TITLE, there stdafx.h quite correctly is commented out.

Personally I initially assumed that a problem - in pch.
Therefore simply accented on the first entrance.

22

Re: In what a difference between modes debug and release?

maxapet wrote:

egorych, it would be too simple, but... The way is registered in both cases truly. The order too coincides.

Yes do not drive...

23

Re: In what a difference between modes debug and release?

maxapet wrote:

egorych, it would be too simple, but... The way is registered in both cases truly. The order too coincides.

Yes a pancake.
Well lay out the project somewhere, or give an input remote on the computer... RDP or TeamViewer

24

Re: In what a difference between modes debug and release?

ptl.h It generally any left library. Where and as it at you is installed - search.

25

Re: In what a difference between modes debug and release?

At me normal variants came to an end, now the abnormal:
- To check up #ifdef- c _DEBUG
- To replace <ptl.h> on "ptl.h"
- To open a project file as text and once again to look at a difference of profiles of assembly
- To clean all and  from zero
- To include a detailed broad gull of the compiler and to look there, it too in project adjustments becomes,