[osg-users] OSGExp and Max 2012
Hi all, I just installed Max 2012 (and the SDK) 64-bit, and am trying to compile OSGExp, but when it tries to link OSGHelper I'm getting this linker error: 1OSGHelper.cpp.obj : error LNK2001: unresolved external symbol public: virtual void __cdecl ReferenceMaker::SetReference(int,class ReferenceTarget *) (?SetReference@ReferenceMaker@@UEAAXHPEAVReferenceTarget@@@Z) It's linking to: ${MAXSDK_LIB_DIR}/bmm.lib ${MAXSDK_LIB_DIR}/core.lib ${MAXSDK_LIB_DIR}/geom.lib ${MAXSDK_LIB_DIR}/gfx.lib ${MAXSDK_LIB_DIR}/mesh.lib ${MAXSDK_LIB_DIR}/maxutil.lib ${MAXSDK_LIB_DIR}/maxscrpt.lib ${MAXSDK_LIB_DIR}/manipsys.lib ${MAXSDK_LIB_DIR}/paramblk2.lib and I had Max 2011 before and it was working fine, so I'm not sure where this problem comes from. Has anything changed recently that could affect this? Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, On Fri, May 27, 2011 at 6:56 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: and I had Max 2011 before and it was working fine, so I'm not sure where this problem comes from. Has anything changed recently that could affect this? It compiles fine for me, but I just noticed the following in the Max 2012 SDK release notes: There are some incorrect usages of the reference system that can allow plug-ins to cause instabilities in 3ds Max, and eventually leading to unexpected behavior or crashes. One such case is when plug-ins call ReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 directly on other plug-ins. Doing so only partially updates the reference graph which results in system instability when the reference links are deleted. The visibilityReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 has been changed from public to protected in the class ReferenceMakerhttp://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html and all of its sub-classes, to prevent plug-ins from accidentally calling this method. Plug-ins that have been calling ReferenceMaker::SetReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#ac11372157c1539fe4beb9160e106d739 on objects of types other than themselves or their parent class, will have to change their code to call ReferenceMaker::ReplaceReference()http://download.autodesk.com/global/docs/3dsmaxsdk2012/en_us/cpp_ref/class_reference_maker.html#aa14a0521d1381a989ecd80f385bd instead. I don't understand why it compiles fine for me though. I am using a developer preview version of Max 2012. Maybe this change only appeared in the final release version, but then what was the point of the developer preview! I'll try to download the latest version and see if I can replicate this issue. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Also, as a quick fix, can you try declaring the SetReference method of OSGHelper in a protected namespace? On Fri, May 27, 2011 at 6:56 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: and I had Max 2011 before and it was working fine, so I'm not sure where this problem comes from. Has anything changed recently that could affect this? Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Farshid, Also, as a quick fix, can you try declaring the SetReference method of OSGHelper in a protected namespace? Actually, since it's never called by anyone, I just commented it out. It compiles and exports correctly. Just another data point for you, but is that method useful at all? Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, On Fri, May 27, 2011 at 9:43 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Actually, since it's never called by anyone, I just commented it out. It compiles and exports correctly. Just another data point for you, but is that method useful at all? It might be called internally by Max, since it is overriding the base class method. I'm not 100% sure of this, but it's probably safest to leave it there. Also, what version of Visual Studio are you compiling with? The version of the 2012 SDK I'm using does include the previously mentioned change. So I'm thinking we might have different compilers. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Farshid, It might be called internally by Max, since it is overriding the base class method. I'm not 100% sure of this, but it's probably safest to leave it there. Seems to me that if it's not in the libs, then it can't be called by Max... Unless there's a bug in the libs I'm using (perhaps solved by a service pack?) Also, what version of Visual Studio are you compiling with? The version of the 2012 SDK I'm using does include the previously mentioned change. So I'm thinking we might have different compilers. I'm compiling on VC9 x64 for Max 2012 x64 running on Windows 7 x64. :-) So, what do you suggest? Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, I'm compiling on VC9 x64 for Max 2012 x64 running on Windows 7 x64. :-) That's also my setup. Strange. So, what do you suggest? Can you post the contents of the buildnumber.h max header file? Also, try building using the solution files in the VisualStudio folder. Maybe there is some project setting that CMake isn't setting properly. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Farshid, Can you post the contents of the buildnumber.h max header file? /* This file is automatically generated by the DailyBuild script. */ /* VERSION_STRING is the build's posting, ie. MXXX, Daily, Midday. */ /* VERSION_INT is the last successful major (MXXX) with the letter prefix (M) dropped. */ #if defined(GAME_FREE_VER) #define VERSION_STRING C000 #define VERSION_INT 0 #elif defined(GAME_VER) #define VERSION_STRING G000 #define VERSION_INT 0 #elif defined(WEBVERSION) #define VERSION_STRING M000 #define VERSION_INT 0 #elif defined (DESIGN_VER) #define VERSION_STRING B000 #define VERSION_INT 0 #else // MAX #define VERSION_STRING Rampage with PDBs MAX_R121_64_RL 02-22-2011 21:37 143392 #define VERSION_INT 121 #endif Also, try building using the solution files in the VisualStudio folder. Maybe there is some project setting that CMake isn't setting properly. Yes, that helped find out what was amiss. The CMake build setup was missing a define _USRDLL. With this defined (and the SetReference() method uncommented) it builds and runs fine. The modified file is attached. I added the define before adding the src subdirectory, instead of inside each project individually, so it will get added to all projects. That is also the case in the projects under the VisualStudio folder (I checked), so I assume this is OK. Perhaps you could add a comment as to why this is required (other than to fix the linker error I don't know). Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ cmake_minimum_required(VERSION 2.6) set( ProjectName OSGExp ) project( ${ProjectName} ) set (CMAKE_BUILD_TYPE Release) list( APPEND CMAKE_MODULE_PATH ${OSGExp_SOURCE_DIR}/CMakeModules ) # Platform specific definitions IF(WIN32) IF(MSVC) # To enable /MP, parralel build on MSVC OPTION(WIN32_USE_MP Set to OFF to diable /MP. ON) MARK_AS_ADVANCED(WIN32_USE_MP) IF(WIN32_USE_MP) SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /MP) ENDIF(WIN32_USE_MP) # Other MSVC compilation flags ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ENDIF(MSVC) ENDIF (WIN32) SET(CMAKE_DEBUG_POSTFIX d CACHE STRING add a postfix, usually d) SET(CMAKE_RELEASE_POSTFIX CACHE STRING add a postfix, usually empty) SET(CMAKE_RELWITHDEBINFO_POSTFIX rd CACHE STRING add a postfix, usually rd) SET(CMAKE_MINSIZEREL_POSTFIX s CACHE STRING add a postfix, usually s) # # Find Max SDK headers and libraries # find_path(MAXSDK_INCLUDE_DIR max.h HINTS $ENV{MAXSDK} PATH_SUFFIXES include ) # If compiling for 64 bit, look for the 64 bit libraries # In the default Max 2011 SDK install, the 32 bit libraries are # in ${MAXSDK}/lib, and 64 bit ones are in ${MAXSDK}/x64/lib SET(MAXSDK_LIB_PATH_SUFFIX lib) IF(CMAKE_SIZEOF_VOID_P MATCHES 8) SET(MAXSDK_LIB_PATH_SUFFIX x64/lib) MARK_AS_ADVANCED(LIB_POSTFIX) ENDIF() find_path(MAXSDK_LIB_DIR maxutil.lib HINTS $ENV{MAXSDK} PATH_SUFFIXES ${MAXSDK_LIB_PATH_SUFFIX} ) SET(MAXSDK_LIBRARIES ${MAXSDK_LIB_DIR}/bmm.lib ${MAXSDK_LIB_DIR}/core.lib ${MAXSDK_LIB_DIR}/geom.lib ${MAXSDK_LIB_DIR}/gfx.lib ${MAXSDK_LIB_DIR}/mesh.lib ${MAXSDK_LIB_DIR}/maxutil.lib ${MAXSDK_LIB_DIR}/maxscrpt.lib ${MAXSDK_LIB_DIR}/manipsys.lib ${MAXSDK_LIB_DIR}/paramblk2.lib ) find_path(MAX_DIR 3dsmax.exe # No hints... ) add_definitions(-D_USRDLL) add_subdirectory(src) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp and Max 2012
Hi Jean-Sébastien, Yes, that helped find out what was amiss. The CMake build setup was missing a define _USRDLL. With this defined (and the SetReference() method uncommented) it builds and runs fine. The modified file is attached. I added the define before adding the src subdirectory, instead of inside each project individually, so it will get added to all projects. That is also the case in the projects under the VisualStudio folder (I checked), so I assume this is OK. Thanks, I just committed it. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org