after having fought during two hours because of VS reporting a buffer overrun when simply creating/deleting a Assimp::Importer object, I found the reason why and decided to re-open this topic.
In VS, it seems there are some property sheets that define which preprocessor definition are applied.
My specific issue is due to the fact that :
- _SECURE_SCL=0 is defined in debug mode (not in my app)
- _HAS_ITERATOR_DEBUGGING=0 is defined in debug mode (not in my app)
- _DEBUG is not defined in debug mode
Also, my app define (in debug mode) _CRTDBG_MAP_ALLOC, but assimp doesn't.
So in my opinion there is a need to be able to customize those easily, as every app is likely to use a different combination of those flag.
I was think about having a config file that would get included at the very begining by each assimp file.
I agree such a configuration fil would be nice. If Assimp is used in a DLL, no problems should occur after I did what we discussed and removed any STL structures being passed from the app to Assimp.
For static linkage the problem is still there (there's also a doc section on it, but I confess that I forgot about the CRT mem flag ...)
With aiDefines.h and AssimpPCH.h we do alreafy have two config headers which are included everywhere. Would be easy to add there ..
I'm also interested in some other opinions on this topic!
Bye,
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
after having fought during two hours because of VS reporting a buffer overrun when simply creating/deleting a Assimp::Importer object, I found the reason why and decided to re-open this topic.
In VS, it seems there are some property sheets that define which preprocessor definition are applied.
My specific issue is due to the fact that :
- _SECURE_SCL=0 is defined in debug mode (not in my app)
- _HAS_ITERATOR_DEBUGGING=0 is defined in debug mode (not in my app)
- _DEBUG is not defined in debug mode
Also, my app define (in debug mode) _CRTDBG_MAP_ALLOC, but assimp doesn't.
So in my opinion there is a need to be able to customize those easily, as every app is likely to use a different combination of those flag.
I was think about having a config file that would get included at the very begining by each assimp file.
something like:
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#else
#define _SECURE_SCL=0
#define _HAS_ITERATOR_DEBUGGING=0
#endif
etc... where everyone could easily define/undefine them.
It would be interesting to listen what others have to say about this!
Cheers,
Gregory
Hi Grégory,
I agree such a configuration fil would be nice. If Assimp is used in a DLL, no problems should occur after I did what we discussed and removed any STL structures being passed from the app to Assimp.
For static linkage the problem is still there (there's also a doc section on it, but I confess that I forgot about the CRT mem flag ...)
With aiDefines.h and AssimpPCH.h we do alreafy have two config headers which are included everywhere. Would be easy to add there ..
I'm also interested in some other opinions on this topic!
Bye,
Alex