nvDXTlib on Visual Studio 2005
#1
Posted 17 June 2006 - 11:56 AM
Got an annoying problem. I've been using Visual Studio 2002 and now switched to VS 2005. Everything compiles fine. However, when i try to link my program, it complains, that the following symbols are undefined:
nvDXTlibMT.lib(NormalMapGen.obj) : error LNK2019: Undefined extern Symbol ""public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)" in Funktion ""public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z)".
nvDXTlibMT.lib(NormalMapGen.obj) : error LNK2019: Undefined extern Symbol ""public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)" in Funktion ""protected: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z)".
I use the nvDXTlib to load DDS files. Now, suddenly, after switching to VS 2005 i get these two error-messages. It seems, as if the programmers of the nvDXTlib used an implementation of the STL, that is not compatible to the one shipping with VS 2005.
Did anyone else encounter this problem? Any ideas how to work around it?
Note, that i downloaded the most recent nvDXTlib, but there seems to be no update, that fixes this problem.
Jan.
#2
Posted 17 June 2006 - 09:32 PM
#3
Posted 18 June 2006 - 12:56 PM
#4
Posted 18 June 2006 - 04:28 PM
#5
Posted 18 June 2006 - 07:18 PM
Jan said:
If nobody has a good alternative to nvdxt, the best route is to just keep bugging nVidia.
#6
Posted 18 June 2006 - 10:14 PM
I mean, if they would release their source-code, everyone could just compile it himself. I was really happy to get free code, that would deal with DDS file loading, since i don't want to do that myself. But in the end all this is counter-productive.
I already send them an "error-report" (try sending them the error-message if you are not allowed to send them more than 900 characters!). I don't expect an answer, though.
Jan.
#7
Posted 19 June 2006 - 12:51 AM
I know, it's a dirty hack, but...
#8
Posted 19 June 2006 - 02:03 AM
#9
Posted 19 June 2006 - 10:01 PM
Hope I'm not mudding the issue.
#10
Posted 19 June 2006 - 11:57 PM
I think it's a piece of ****.
The code simply does not load DDS files. At least not files created with nVidias Photoshop plugin. I put some debug output into the loading code and the "load" function, that is supposed to read the DDS file fails at recognizing the DDS file. First it checks whether "DDS" is written in the file, which seems not to be the case (at least not where it tries to read it). Of course all subsequent checks (DXT FOURCC Code, ...) also fail.
I really need code, that reads a DDS file and is able to decode it, because i need the raw, uncompressed data. Exactly what the nvDXTlib does. I rewrote my whole texture-loading code, to at least be able to directly upload the data, because the Cg lib is not able to decode the loaded data. But then it simply didn't read the file at all, GRRRR !!!
Cunning as i am, i now SOLVED the problem :-D Yeah, i know, i am great. How i did it? I removed the DDS loading code and now load TGA files, again. Great, isn't it.
Maybe i will reinstall VS 2002 only because of this. Or i switch to D3D. So many options!
So, in the end i ask you: Did nVidia really do us a favor in releasing a library, that first allowed us to use the DDS format, but then dropping support for it, so that we are now hanging in the air and need to somehow do all this on our own? I think not.
I'm mighty disappointed.
Jan.
#11
Posted 20 June 2006 - 01:25 AM
If you wanted to develop your own DXT reading library, you could maybe start with the Cg stuff and then add decoding logic based on the information in this document, which describes the precise format of the compressed data (in the appendix).
#12
Posted 09 August 2006 - 05:08 PM
//
// Crap to make the nvDXTLib link with the new VS8.
//
namespace std
{
//
// From old VS7 xstring.
//
class _CRTIMP2 _String_base
{
public:
void _Xlen() const;
void _Xran() const;
};
//
// From new VS8 xstring.
//
//
// class _CRTIMP2_PURE _String_base : public _Container_base
// {
// public:
// _MRTIMP2_NPURE_NCEEPURE static void __CLRCALL_PURE_OR_CDECL _Xlen();
// _MRTIMP2_NPURE_NCEEPURE static void __CLRCALL_PURE_OR_CDECL _Xran();
// _MRTIMP2_NPURE_NCEEPURE static void __CLRCALL_PURE_OR_CDECL _Xinvarg();
// };
//
//
// From old VS7 string.cpp
//
_CRTIMP2 void _String_base::_Xlen() const
{
//
// _THROW(length_error, "string too long");
//
throw("string too long");
}
_CRTIMP2 void _String_base::_Xran(void) const
{
//
// _THROW(out_of_range, "invalid string position");
//
throw("invalid string position");
}
}
#13
Posted 09 August 2006 - 05:36 PM
http://www.sjbrown.co.uk/?code=squish
There is an API to encode whole images (even though the webpage doesn't mention it). It doesn't have all the features of the nVidia encoder and doesn't deal with resampling image, but it does a good job of encoding and is about as fast as the nVidia encoder.
As for decoding... well apart from it being trivial, I can see no good reason to need a software decoder. The whole point of s3tc is to let the HW do it. As for a dds loader... well the loader shouldn't decode the DXT blocks... just leave them in-tact. My own dds loader does happen to flip the image rows (cuz we're using OpenGL not DX) but that can be done without decoding the blocks... just massaging them a little.
tga's are great. Maybe consider having your pipeline use Squish or nvDXTLib to encode and generate the mipmap levels automatically.
#14
Posted 09 August 2006 - 07:27 PM
Great, thanks!
Of course S3TC is about decoding that stuff in hardware. But sometimes you need a software-decoder, because you want to make a tool that processes image data. DDS is mainly about getting the textures into the hardware efficiently, but sometimes you need to work on the raw image-data.
Jan.
#15
Posted 10 August 2006 - 06:43 PM
Hope the code worked for you. I suppose the discussion of a software dxt decoder is a bit of a philosophical one... but I think reasonably important. I suppose I agree that there are rare cases where a decoder could be justified... like for a dds viewer where you don't want the image to look like what the HW would give you (ex: older nVidia cards use 16bit interpolation... giving that ugly banding). Another reasonable use might be validating or computing error metrics for various compression schemes (HW or SW).
However, since s3tc is lossy... and badly lossy at that (much worse than, say, a jpg, at the same file-size), I think it's a mistake to process the dxt blocks except for simple lossless manipulations (row flips, mirror images, etc). Personally I don't even like doing edits to jpg's, and the generation loss with a jpg is much lower than with a s3tc image.
Processing dds files in general is reasonable though... there are many other supported pixel formats... many of which are lossless in an editable way.
Anyways, these are clearly just my opinions... obviously Photoshop with the NV dxt plugin allows editing dds's with dxt data in them... so I suppose there are smart people out there that disagree with me ;) ah well.
#16
Posted 12 September 2006 - 01:57 PM
has anyone gotten tri's snippet code from above to run? If I put it in my cpp file, I get class redifinition errors (right where _String_base gets defined).
Can anyone help?
Cheers,
Sebastian
#17
Posted 13 September 2006 - 06:49 PM
Create a new module and define LEAN_AND_MEAN before including windows.h. Then use the code above.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












