Jump to content

  • Log In with Google      Sign In   
  • Create Account


Namespace problem with boost and maxsdk


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lucky6969b   Members   -  Reputation: 572

Like
0Likes
Like

Posted 07 November 2013 - 03:19 AM

 
#include "kwxport.h"

#include "resource.h"

#ifndef __TCONVERT_H__
#define __TCONVERT_H__
#endif
#ifndef _INC_TCHAR
# include <tchar.h>
#endif
#ifndef _INC_CRTDBG
# include <crtdbg.h>
#endif
#ifndef _WINDOWS_
# include <windows.h>
#endif

#include <d3dx9xof.h>
#include "rmxftmpl.h"
#include "rmxfguid.h"
#include <d3dx9mesh.h>

#include <dbghelp.h>
#include <plugapi.h>
#include <hold.h>
#include <quat.h>
#include <IDxMaterial.h>
#include <IPathConfigMgr.h>
#include <crtdbg.h>
#include <maxapi.h>
#include <interval.h>

#include <set>
#include <algorithm>
#include <sstream>

//#include "kwlog.h"
#include "exportmain.h"


#define USE_FILE_RESOLUTION 0
#define IGAME_BUG 0
#if defined(MAX_RELEASE)
#if defined(MAX_RELEASE_R12_ALPHA) && MAX_RELEASE >= MAX_RELEASE_R12_ALPHA
#undef USE_FILE_RESOLUTION
#define USE_FILE_RESOLUTION 1
#include <AssetManagement/AssetUser.h>
#include <IFileResolutionManager.h>
#pragma comment(lib, "assetmanagement.lib")
#if defined(_M_X64)
#undef IGAME_BUG
#if !defined(MAX_RELEASE_R13) || MAX_RELEASE < MAX_RELEASE_R13
#define IGAME_BUG 1
#else
#define IGAME_BUG 0
#endif
#endif
#endif
#else
#error "MAX_RELEASE must be defined!"
#endif

//TODO: for 1.5, support sorting transparent material triangles and splitting 2-sided triangles
//TODO: for 1.5, convert textures to DDS when "rename to dds" and "copy textures" are on
//TODO: for 1.5, convert the settings interface to use real ParamBlk2, and expose a Utility
// that allows editing it.

//BUG: There appears to be a pivot center offset problem
//FIXED: There appears to be some problem with non-contiguous texture map channels

#if 0 // todo: remember to set to 0 before ship!
#define OPTIMIZED 0
#else
#define OPTIMIZED 1
#endif

#if !OPTIMIZED
#pragma optimize("", off)
#endif

#include <boost/property_tree/ptree.hpp> <<<<<<<<<<< Error 2544
#include <boost/property_tree/xml_parser.hpp>

// Create an empty property tree object
using boost::property_tree::ptree;
ptree exportedData;


#pragma comment(lib, "bmm.lib")
//#pragma warning(disable: 4312) // cast int/pointer

#define MAX_UV_SETS 4

 
Warning    1    warning C4003: not enough actual parameters for macro 'base_type'    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    2    error C2544: expected ')' for operator '()'    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    3    error C2059: syntax error : '('    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    4    error C2091: function returns function    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    5    error C2143: syntax error : missing ',' before '&'    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    6    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
Error    7    error C2059: syntax error : '('    E:\Programming\Libraries\boost_1_54_0\boost\serialization\collection_size_type.hpp    41    1    kwxport
[/code]

The maxsdk and boost both have the base_type methods.

Tried to include the boost::serialization namespace to to avail

Thanks

Jack


Edited by lucky6969b, 07 November 2013 - 03:23 AM.


Sponsor:

#2 Zaoshi Kaba   Crossbones+   -  Reputation: 3880

Like
1Likes
Like

Posted 07 November 2013 - 04:28 AM

Try different include order and do not to use "using namespace ..." (if you have any in your .cpp).



#3 NightCreature83   Crossbones+   -  Reputation: 2689

Like
0Likes
Like

Posted 07 November 2013 - 04:31 AM

You can also wrap one of the includes into another namespace everywhere you use it that should fix your issue as well. You should be very careful with using namespace <bla> as these will import all the names in that space into the current namespace and potentially pollute it.

namespace MAX_SDK
{
#include <maxsdk.h>
}


Edited by NightCreature83, 07 November 2013 - 04:33 AM.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, Mad Max

#4 Bregma   Crossbones+   -  Reputation: 4836

Like
2Likes
Like

Posted 07 November 2013 - 06:29 AM

not enough actual parameters for macro 'base_type'

 

This implies maxsdk has a preprocessor macro 'base_type'.  Try using a replacement library that works with code written in the 1990s or later.

 

C preprocessor macros do not have namespaces and any header that uses them like that is bad software.  You might be able to work around the problem by adding an "#undef base_type" after the #include for your maxsdk headers.


Stephen M. Webb
Professional Free Software Developer

#5 LorenzoGatti   Crossbones+   -  Reputation: 2586

Like
0Likes
Like

Posted 08 November 2013 - 05:07 AM

#undef base_type" after the #include for your maxsdk headers.

killing off troublesome macros with #undef is the only safe and general solution.
In this case moving the Boost include directives far earlier in the file (line 1 is a good choice), before naughty headers soil the preprocessor, should also work because they are libraries and nothing in the other includes depends on them.
Produci, consuma, crepa




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS