Why can't I compile my JAI SDK project on the latest version of Microsoft Visual Studio?

Note: This article is about the JAI SDK, which is now obsolete.

The JAI SDK has been tested with different versions of Microsoft Visual Studio up to version 2012.

The code samples are written using MS Visual Studio 2005.

It is possible to use the SDK with later versions of Visual Studio, but it may require both of the following two steps:

Step 1:

Modifying the GCLinkage.h file, located in C:\Program Files\JAI\SDK\library\CPP\include\Base. It must include the _MSC_VER version of Visual Studio that you are using. An updated list of versions can be seen here:

// _MSC_VER==1310 : MSVC++ 7.1 : Visual Studio .NET 2003
// _MSC_VER==1400 : MSVC++ 8.0 : Visual Studio 2005
// _MSC_VER==1500 : MSVC++ 9.0 : Visual Studio 2008
// _MSC_VER==1600 : MSVC++ 10.0 : Visual Studio 2010
// _MSC_VER==1700 : MSVC++ 11.0 : Visual Studio 2012
// _MSC_VER==1800 : MSVC++ 12.0 : Visual Studio 2013
// _MSC_VER==1900 : MSVC++ 14.0 : Visual Studio 2015
// _MSC_VER==1910 : MSVC++ 14.1 : Visual Studio 2017 v15.0
// _MSC_VER==1911 : MSVC++ 14.11 : Visual Studio 2017 v15.3
// _MSC_VER==1912 : MSVC++ 14.12 : Visual Studio 2017 v15.5
// _MSC_VER==1913 : MSVC++ 14.13 : Visual Studio 2017 v15.6
// _MSC_VER==1914 : MSVC++ 14.14 : Visual Studio 2017 v15.7
// _MSC_VER==1915 : MSVC++ 14.15 : Visual Studio 2017 v15.8
// _MSC_VER==1916 : MSVC++ 14.16 : Visual Studio 2017 v15.9
// _MSC_VER==1920 : MSVC++ 14.2 : Visual Studio 2019 v16.0

# if !( _MSC_VER>=1310 && _MSC_VER<=1920) // To include all of the above, including untested
# error Invalid compiler
# endif

Visual Studio versions later than 2012 may give warnings about not declaring a variable when using the typedefs in Jai_Factory.h (“'typedef ': ignored on left of '_J_DEVICE_ACCESS_FLAGS_TYPE' when no variable is declared”). It’s caused by code like this:
typedef enum _J_DEVICE_ACCESS_FLAGS_TYPE
{
DEVICE_ACCESS_MAX_ID = DEVICE_ACCESS_CUSTOM_ID + 1
};

It’s a harmless warning but can easily be fixed by just adding a dummy variable name at the end of the typedef.

Step 2:

You may need to modify the sample project to use the relevant version of the Platform Toolset for your combination of Windows / dotNET versions. See https://msdn.microsoft.com/en-us//library/ff770576.aspx

 

Products: JAI SDK

Compatibility: MSVS, MS, Microsoft Visual Studio

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.