# Weird error when using the FBX SDK...

This topic is 2964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

This is really weird. I have a project (a DLL if that matters) and I'm using Visual Studio 2008 Express Edition. I need to load models, before I used the lib3ds and everything was fine. Now I want to actually display properly animated models and so I went for FBX and the respective SDK. I can open the included example projects, compile and run them absolutely fine, but in my own project there is some trouble. I have, of course, added both the "include" and the "lib" folder from the sdk and added the additional dependency "fbxsdk_md2008d.lib" - the project is also set to "multi-threaded debug dll" etc. First of all, I get a shitload of errors when I don't include <fbxsdk.h> at the top before anything else. If I only go as far as including the allegro libraries before, I have 100+ errors in the fbxsdk header files. Can this even be right? If I include it at the top, it introduces one tiny error in this line:
device->SetTransform ( D3DTS_WORLD, &( scaling_matrix * ( rotation_matrices[0] * rotation_matrices[1] * rotation_matrices[2] ) * translation_matrix ) );

error C4238: nonstandard extension used : class rvalue used as lvalue

This is in the model::Draw function and all the xxx_matrices are simply vectors. I know there is no problem with any of this because, without the dang FBX SDK it all works smoothly. I can't find a lot of information on that error and with the example on the MSDN I don't see any connection to my situation there. For reference, I did compare all project settings side-to-side with the example project and set EVERYTHING equal and it's still the same. I'm thoroughly confused and I'd appreciate any help whatsoever. Please let me know if I wasn't specific enough, you need more info etc. Thanks ahead of time.

##### Share on other sites
Quote:
 error C4238: nonstandard extension used : class rvalue used as lvalue

As it says on the tin you are taking the address of the rhs value(temporary) which is not standard. Preform the calculation then then pass the address. Why it is giving an error I have no idea as this is a microsoft extension and is even used by DX maths functions IIRC, it only used to give a warning even with /w4. Unless you have disabled language extensions, but in that case you would have far far more errors.

##### Share on other sites
You're right, this works:

combined_matrix = scaling_matrix * ( rotation_matrices[0] * rotation_matrices[1] * rotation_matrices[2] ) * translation_matrix;	// use multiplied matrices	device->SetTransform ( D3DTS_WORLD, &combined_matrix );

Still confused as to why the FBX SDK had any influence on this but it's good to know this works.

I have language extensions activated btw.

Thanks for the quick help.

##### Share on other sites
Try searching in the FBX SDK for the string "#pragma warning". I'll bet you'll find a pragma that turns on that warning (C4238, it's actually a warning by default), and turns it into an error.

A quick search seems to show that this file is part of the SDK:
kaydara.h
In there, you'll see "#pragma warning(error : 4238)", which turns on your warning as an error.

If this bugs you (but you should be paying attention to the warning, as magic_man explained!), you can store the current warning setup state before you include the header, and restore it after:

#pragma warning(push)#include <fbxsdk.h>#pragma warning(pop)

##### Share on other sites
Okay that explains one or two things. Although I didn't ever notice a warning before there either...

Anyways, thanks for the help.

##### Share on other sites

This topic is 2964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account