castano / nvidia-texture-tools

Texture processing tools with support for Direct3D 10 and 11 formats.
https://github.com/castano/nvidia-texture-tools/wiki
Other
574 stars 213 forks source link

Errors building vc12/nvtt.sln with Visual Studio 2013 Community (Update 5) - CUDA #242

Open JustAndreww opened 8 years ago

JustAndreww commented 8 years ago

Hi,

I'm using Windows 7 x64 + Visual Studio 2013.5 + CUDA 7.5.

First error will appear:

Error   1   error C2065: 'uint8_t' : undeclared identifier  src\nvimage\ImageIO.cpp 327 1   nvimage

Can be fixed via adding to ImageIO.cpp:

#include <stdint.h>

After fixing that and adding CUDA Include directory to nvtt solution additional directories I've met following errors in CudaUtils.cpp:

Error   1   error C2065: 'Library' : undeclared identifier  src\nvtt\cuda\CudaUtils.cpp 80  1   nvtt
Error   2   error C2146: syntax error : missing ';' before identifier 'nvcuda'  src\nvtt\cuda\CudaUtils.cpp 80  1   nvtt
Error   3   error C3861: 'nvcuda': identifier not found src\nvtt\cuda\CudaUtils.cpp 80  1   nvtt
Error   4   error C2065: 'nvcuda' : undeclared identifier   src\nvtt\cuda\CudaUtils.cpp 85  1   nvtt
Error   5   error C2228: left of '.isValid' must have class/struct/union    src\nvtt\cuda\CudaUtils.cpp 85  1   nvtt
Error   6   error C2065: 'nvcuda' : undeclared identifier   src\nvtt\cuda\CudaUtils.cpp 93  1   nvtt
Error   7   error C2228: left of '.bindSymbol' must have class/struct/union src\nvtt\cuda\CudaUtils.cpp 93  1   nvtt
Error   8   error C2065: 'nvcuda' : undeclared identifier   src\nvtt\cuda\CudaUtils.cpp 102 1   nvtt
Error   9   error C2228: left of '.bindSymbol' must have class/struct/union src\nvtt\cuda\CudaUtils.cpp 102 1   nvtt
Error   10  error C2065: 'nvcuda' : undeclared identifier   src\nvtt\cuda\CudaUtils.cpp 113 1   nvtt
Error   11  error C2228: left of '.bindSymbol' must have class/struct/union src\nvtt\cuda\CudaUtils.cpp 113 1   nvtt

That code in CudaUtils.cpp is causing such error:

#if NV_OS_WIN32
    Library nvcuda("nvcuda.dll");
#else
    Library nvcuda(NV_LIBRARY_NAME(cuda));
#endif

It seems that is somehow relates to: https://github.com/castano/nvidia-texture-tools/issues/230

Returning Library.h and Library.cpp will produce different set of errors:

Error   1   error LNK2001: unresolved external symbol compressKernelDXT3    vc12\nvtt\CudaCompressorDXT.obj nvtt
Error   2   error LNK2001: unresolved external symbol setupOMatchTables vc12\nvtt\CudaCompressorDXT.obj nvtt
Error   3   error LNK2001: unresolved external symbol setupCompressKernel   vc12\nvtt\CudaCompressorDXT.obj nvtt
Error   4   error LNK2001: unresolved external symbol compressKernelDXT1    vc12\nvtt\CudaCompressorDXT.obj nvtt
Error   5   error LNK2001: unresolved external symbol bindTextureToArray    c12\nvtt\CudaCompressorDXT.obj  nvtt

So, I'm really stuck. Can't even build this tool to test how it works.

Is there any latest binaries with CUDA available?

Thanks!

zenoengine commented 7 years ago

I have same problem. anyone help me please. :cry:

charlietangora commented 7 years ago

Try adding the Cuda library to "Build Customizations" (in the project right-click menu.)

chidea commented 6 years ago

These files are missing in nvcore. https://github.com/casseveritt/nvidia-texture-tools/blob/master/src/nvcore/Library.h https://github.com/casseveritt/nvidia-texture-tools/blob/master/src/nvcore/Library.cpp Their include macros should have "nvcore/" before them like below.

include "nvcore/nvcore.h"

include "nvcore/Debug.h"

This line has to be in the top of CudaUtils.cpp in nvtt.

include "nvcore/Library.h"