Release VS. Debug

Release VS. Debug

Anonymous
Not applicable
398 Views
5 Replies
Message 1 of 6

Release VS. Debug

Anonymous
Not applicable
Can anyone tell me the difference between release
and debug version? Because I have this problem - I have this arx preject,
compile it in Debug configuration - it's ok, then try to build the
ReleaseMinDependancy configuration - it gives me a redefinition. First it was
__free  and __malloc, then it was a redefinition of my Interface (I am
writing a COM server):

 


size=2>E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(38) : error C2370:
'LIBID_VBEXTEND3Lib' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(64) : see declaration of
'LIBID_VBEXTEND3Lib'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(41) :
error C2370: 'IID_ICurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(73) : see declaration of
'IID_ICurveX'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(44) : error
C2370: 'CLSID_CurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(380) : see declaration of
'CLSID_CurveX'
Generating Code...
Error executing
cl.exe.

 

VBExtend3.arx - 3 error(s), 0
warning(s)

 

ICurveX is my interface, and VBExtend is the
project's name. Why don't I get these with the Debug version? What am I doing
wrong and any ideas where can I read about it or how to fix
it?

 

Thanks

 

Blade

 
0 Likes
399 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
hello,

 

try to compile in just W32release, it may
work.

 

chris
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi,

When the ATL COM AppWizard generates the default project, it defines the
macro _ATL_MIN_CRT. This macro is defined so that you don't bring the C
Run-Time Library into your code if you don't need it.

Therefore, you need to remove the _ATL_MIN_CRT macro.

On your Project Settings, for Rease version, on C/C++ tab, choose
the General category, then remove _ATL_MIN_CRT from the
Preprocessor definitions edit box.

 

Aragao


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Can anyone tell me the difference between release
and debug version? Because I have this problem - I have this arx preject,
compile it in Debug configuration - it's ok, then try to build the
ReleaseMinDependancy configuration - it gives me a redefinition. First it was
__free  and __malloc, then it was a redefinition of my Interface (I am
writing a COM server):

 


size=2>E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(38) : error C2370:
'LIBID_VBEXTEND3Lib' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(64) : see declaration of
'LIBID_VBEXTEND3Lib'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(41) :
error C2370: 'IID_ICurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(73) : see declaration of
'IID_ICurveX'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(44) : error
C2370: 'CLSID_CurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(380) : see declaration of
'CLSID_CurveX'
Generating Code...
Error executing
cl.exe.

 

VBExtend3.arx - 3 error(s), 0
warning(s)

 

ICurveX is my interface, and VBExtend is the
project's name. Why don't I get these with the Debug version? What am I doing
wrong and any ideas where can I read about it or how to fix
it?

 

Thanks

 

Blade

 
0 Likes
Message 4 of 6

Anonymous
Not applicable
I don't know guys, but it's not it. This
ATL_MIN_CRT macro is set only for ReleaseMinSize and it doesn't matter if I
remove it or not. That is not it. The problem is that even if I comment out
these redefinitions, on build something uncomments them... Help

 

Blade

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi,

When the ATL COM AppWizard generates the default project, it defines the
macro _ATL_MIN_CRT. This macro is defined so that you don't bring the C
Run-Time Library into your code if you don't need it.

Therefore, you need to remove the _ATL_MIN_CRT macro.

On your Project Settings, for Rease version, on C/C++ tab, choose
the General category, then remove _ATL_MIN_CRT from the
Preprocessor definitions edit box.

 

Aragao


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Can anyone tell me the difference between
release and debug version? Because I have this problem - I have this arx
preject, compile it in Debug configuration - it's ok, then try to build the
ReleaseMinDependancy configuration - it gives me a redefinition. First it
was __free  and __malloc, then it was a redefinition of my Interface (I
am writing a COM server):

 


size=2>E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(38) : error C2370:
'LIBID_VBEXTEND3Lib' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(64) : see declaration of
'LIBID_VBEXTEND3Lib'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(41) :
error C2370: 'IID_ICurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(73) : see declaration of
'IID_ICurveX'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(44) : error
C2370: 'CLSID_CurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(380) : see declaration of
'CLSID_CurveX'
Generating Code...
Error executing
cl.exe.

 

VBExtend3.arx - 3 error(s), 0
warning(s)

 

ICurveX is my interface, and VBExtend is the
project's name. Why don't I get these with the Debug version? What am I
doing wrong and any ideas where can I read about it or how to
fix it?

 

Thanks

 

Blade


size=2>
 
0 Likes
Message 5 of 6

Anonymous
Not applicable
Vladi,

 

Did you have checked all your #ifdef directives on
the top of all header files?

 

If you are using #import directive, did you have
checked for a miss of a redefinition macro?

 

If you did not create this project using ARX
Wizard, did you put the StdAfx.h DEBUG tags:

 

// Check if the build is DEBUG version and it's
intended
// to be used with Non-DEBUG AutoCAD.
// In this case, for MFC
header files, we need to undefine
// _DEBUG symbol
#if defined( _DEBUG)
&& !defined(DEBUG_THIS_APP_ONLY)
    #pragma
message("Building debug to be used with release AutoCAD")
   
#define DEBUG_THIS_APP_ONLY
    #undef
_DEBUG
#endif

 

#include <afxwin.h>

 

// Turn on the _DEBUG symbol if it was defined,
before including
// non-MFC header files.
//
#ifdef
DEBUG_THIS_APP_ONLY
    #define _DEBUG
   
#undef DEBUG_THIS_APP_ONLY
#endif

Let us know if you solve this issue...

Regards,

Fernando.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I don't know guys, but it's not it. This
ATL_MIN_CRT macro is set only for ReleaseMinSize and it doesn't matter if I
remove it or not. That is not it. The problem is that even if I comment out
these redefinitions, on build something uncomments them... Help

 

Blade

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi,

When the ATL COM AppWizard generates the default project, it defines
the macro _ATL_MIN_CRT. This macro is defined so that you don't bring
the C Run-Time Library into your code if you don't need it.

Therefore, you need to remove the _ATL_MIN_CRT macro.

On your Project Settings, for Rease version, on C/C++ tab,
choose the General category, then remove _ATL_MIN_CRT from the
Preprocessor definitions edit box.

 

Aragao


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Can anyone tell me the difference between
release and debug version? Because I have this problem - I have this arx
preject, compile it in Debug configuration - it's ok, then try to build
the ReleaseMinDependancy configuration - it gives me a redefinition. First
it was __free  and __malloc, then it was a redefinition of my
Interface (I am writing a COM server):

 


size=2>E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(38) : error C2370:
'LIBID_VBEXTEND3Lib' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(64) : see declaration of
'LIBID_VBEXTEND3Lib'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(41)
: error C2370: 'IID_ICurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(73) : see declaration of
'IID_ICurveX'
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3_i.c(44) : error
C2370: 'CLSID_CurveX' : redefinition; different storage
class
       
E:\Vlado\#U.A.S.G\C++\VBExtend3\VBExtend3.h(380) : see declaration of
'CLSID_CurveX'
Generating Code...
Error executing
cl.exe.

 

VBExtend3.arx - 3 error(s), 0
warning(s)

 

ICurveX is my interface, and VBExtend is the
project's name. Why don't I get these with the Debug version? What am I
doing wrong and any ideas where can I read about it or how
to fix it?

 

Thanks

 

Blade


size=2>
 
0 Likes
Message 6 of 6

Anonymous
Not applicable
Guys, thank for all the help, there is an advance
on this case. But I didn't see anywhere what Fernando said. The build of
releaseMinSize gave the following
errors:Linking...MSVCRT.lib(dllsupp.obj) : error LNK2005:
__fltused already defined in StdAfx.objMSVCRT.lib(dllsupp.obj) : warning
LNK4006: __fltused already defined in StdAfx.obj; second definition
ignored   Creating library ReleaseMinSize/VBExtend3.lib and object
ReleaseMinSize/VBExtend3.expVBExtend3.exp : warning LNK4070:
/OUT:VBExtend3.DLL directive in .EXP differs from output filename
"ReleaseMinSize/VBExtend3.arx"; ignoring
directiveReleaseMinSize/VBExtend3.arx : fatal error LNK1169: one or more
multiply defined symbols foundError executing link.exe.I then
started to comment out everything one by one to see what caused the error,
and:// stdafx.cpp : source file that includes just the standard
includes// stdafx.pch will be the pre-compiled header// stdafx.obj will
contain the pre-compiled type information
#include "stdafx.h"
#if defined(_DEBUG) &&
!defined(_DEBUG_AUTOCAD)    #define
_DEBUG_WAS_DEFINED    #undef _DEBUG#endif

#ifdef
_ATL_STATIC_REGISTRY    #include
    #include
#endif
//#include

#include "acad15_i.c"#if
defined(_DEBUG_WAS_DEFINED)#undef _DEBUG_WAS_DEFINED#define
_DEBUG#endif
 
when I commented out this file (atlimpl.cpp) the
errors in ReleaseMinSize stopped. The problem is that I don't know that I did
when I commented out that line. Can you explain me the reason (I am a guy who
wants to know what he is doing when he does it, I want to uderstand it, not
just do it)? Here is the whole StdAfx.h:
 
// stdafx.h : include
file for standard system include files,// or project specific include files
that are used frequently,// but are changed infrequently#if
!defined(AFX_STDAFX_H__C8BC6D2F_9E91_46FC_823F_8201A2BE50F6__INCLUDED_)#define
AFX_STDAFX_H__C8BC6D2F_9E91_46FC_823F_8201A2BE50F6__INCLUDED_
#if _MSC_VER >= 1000#pragma
once#endif // _MSC_VER >= 1000
#if defined(_DEBUG) &&
!defined(_DEBUG_AUTOCAD)    #define
_DEBUG_WAS_DEFINED    #undef _DEBUG#endif

#define STRICT
#ifdef _DEBUG    #define
_ATL_DEBUG_QI    #define
_ATL_DEBUG_REFCOUNT#endif
#define _WIN32_WINNT 0x0400#define
_ATL_APARTMENT_THREADED
#include
//You may derive a class from CComModule
and use it if you want to override//something, but do not change the name of
_Module
extern CComModule _Module;
#include //#include "dbmain.h"//#include
"dbents.h"//#include "dbsymtb.h"//#include "dbobjptr.h"//#include
"rxdebug.h"//#include "acdb.h" // acdb definitions#include
"rxregsvc.h" // ARX
linker#include "dbapserv.h" // Host application services#include "aced.h"
// aced stuff//#include
"adslib.h" // RXADS definitions//#include "rxmfcapi.h" // ObjectARX MFC
support//#include "AcExtensionModule.h" // Utility class for extension
dlls#include "dbptrar.h" // void pointer array #include "acad15.h"
// AutoCAD Automation
interfaces#include "axlock.h" // Document locking class (no operation in
ObjectDBX)//#include "oleaprot.h"//#include
"acutmem.h"#include // Added by ClassView#if
defined(_DEBUG_WAS_DEFINED)#undef _DEBUG_WAS_DEFINED#define
_DEBUG#endif//{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert
additional declarations immediately before the previous line.#endif
//
!defined(AFX_STDAFX_H__C8BC6D2F_9E91_46FC_823F_8201A2BE50F6__INCLUDED)
 
I hope this will help, and I hope you'll explain me wny
this (edited) happens so it won't happen anymore. I am a begginer and don't have any
books. I am learning from the MSDN Library and the ObjectARX SDK so I have a lot
fo misses. There is no books for COM or ObjectARX in my country so I am relying
only on you. I have NOONE else to ask. So I am VERY GRATEFUL for any help I
get.
 
Thank you all.
 
Blade
0 Likes