ycwn / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

How to compile NVTT with Visual Studio 2012 #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use CMake to create a solution for VC 11
2. Open solution & compile

What is the expected output? What do you see instead?
- Compilation does not succeeed but will fail in xtgmath.h (which is an deep 
internal file of MSVC and which is OK)

What version of the product are you using? On what operating system?
- MSVC 2012.3

Please provide any additional information below.

The error is NOT located in xtgmath.h, but in nvmath.h which defines 
the following (Which conflicts with MSVC 2012 internals)

#define sqrt sqrt_assert
#define sqrtf sqrtf_assert
#define acos acos_assert
#define acosf acosf_assert
#define asin asin_assert
#define asinf asinf_assert

 -> Solution: disable these defines and NVTT compiles on MSVC 2012+:

#if ! defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER<1700))
    #define sqrt sqrt_assert
    #define sqrtf sqrtf_assert
    #define acos acos_assert
    #define acosf acosf_assert
    #define asin asin_assert
    #define asinf asinf_assert
#endif

regards,
Torben Dannhauer

Original issue reported on code.google.com by tor...@dannhauer.info on 17 Jul 2013 at 10:14

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you!

Original comment by benjamin...@gmail.com on 5 May 2014 at 12:58

GoogleCodeExporter commented 9 years ago
Thanks, I don't have visual studio 2012 to confirm this patch, but I'll apply 
it as suggested.

Original comment by cast...@gmail.com on 21 May 2014 at 5:22

GoogleCodeExporter commented 9 years ago
Issue 203 has been merged into this issue.

Original comment by cast...@gmail.com on 21 May 2014 at 5:23

GoogleCodeExporter commented 9 years ago
This should be fixed in r1383.

Original comment by cast...@gmail.com on 21 May 2014 at 5:25