Page 1 of 1

Compile Problem Visual Studio 2015

Posted: Thu Jul 21, 2016 12:36 am
by sstark
Can't seem to get rid of INTMAX_MAX undeclared which shows up in ratio.h and chrono.h
Everything else looks good (so far)...

Any hints?

partial:
1>------ Build started: Project: QCC_DB_LIB, Configuration: Debug x64 ------
1> ccCameraSensor.cpp
1> ccGBLSensor.cpp
1> ccGenericPointCloud.cpp
1> ccGriddedTools.cpp
1> ccHObject.cpp
1> ccHObjectCaster.cpp
1> ccImage.cpp
1> ccIndexedTransformationBuffer.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(111): error C2065: 'INTMAX_MAX': undeclared identifier
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(123): note: see reference to class template instantiation 'std::ratio<_Nx,_Dx>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(113): error C2065: 'INTMAX_MAX': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(26): error C2065: 'INTMAX_MAX': undeclared identifier
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(165): note: see reference to class template instantiation 'std::_Ratio_add<_R1,_R2>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ratio(216): error C2338: integer arithmetic overflow

Re: Compile Problem Visual Studio 2015

Posted: Thu Jul 21, 2016 6:54 am
by daniel
On my side (with VS 2013) INTMAX_MAX is apparently not used.

It is defined in 'stdint.h' (but in a deactivated section):

Code: Select all

#define INTMAX_MAX   INT64_MAX

Re: Compile Problem Visual Studio 2015

Posted: Thu Jul 21, 2016 7:20 pm
by sstark
INTMAX_MAX is defined in stdint.h but as Daniel said, in a deactivated section...

#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) //

So I added this define: __STDC_LIMIT_MACROS to the CloudCompare project properties (C++ Preprocessor Definitions)

And it compiled. Not sure why that was needed.
Thanks.

Re: Compile Problem Visual Studio 2015

Posted: Sat Sep 03, 2016 3:08 pm
by ksw221
Hi, I resolved this issue with vs2015.
I added __STDC_LIMIT_MACROS definition to "CMakeSetCompilerOptions.cmake" file as follows.

Code: Select all

add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS [b]-D__STDC_LIMIT_MACROS[/b]).
Additionally, I added construction function to GenericIndexedCloudPersist.h file for Registration Tool functionality as follows.

Code: Select all

class CC_CORE_LIB_API GenericIndexedCloudPersist : virtual public GenericIndexedCloud
{

public:
	[b]GenericIndexedCloudPersist() {}[/b]
	//! Default destructor
	virtual ~GenericIndexedCloudPersist() {}

Re: Compile Problem Visual Studio 2015

Posted: Thu Oct 06, 2016 8:45 am
by daniel
It took me some time but I added the same modifications to the project files.

Thanks for the feedback.