Compile Problem Visual Studio 2015

All about Windows versions
Post Reply
sstark
Posts: 2
Joined: Thu Jul 21, 2016 12:30 am

Compile Problem Visual Studio 2015

Post 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
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Compile Problem Visual Studio 2015

Post 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
Daniel, CloudCompare admin
sstark
Posts: 2
Joined: Thu Jul 21, 2016 12:30 am

Re: Compile Problem Visual Studio 2015

Post 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.
ksw221
Posts: 1
Joined: Fri Sep 02, 2016 1:33 am

Re: Compile Problem Visual Studio 2015

Post 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() {}
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Compile Problem Visual Studio 2015

Post by daniel »

It took me some time but I added the same modifications to the project files.

Thanks for the feedback.
Daniel, CloudCompare admin
Post Reply