cancel
Showing results for 
Search instead for 
Did you mean: 

std:: vector of VS 2013 in NX 9.0 crash

Pioneer
Pioneer

Will std::vector of Visual studio 2012 work with NX 9.0 only ?.

 

sample code which is used in Visual studio  2013

 

Annotations::TitleBlock *lTitleBlock(dynamic_cast<Annotations::TitleBlock *>(mPart->FindObject("HANDLE R-165410")));
std::vector<Annotations::TitleBlock*> ltitleblocks(1);
ltitleblocks[0] = lTitleBlock;  
Annotations::EditTitleBlockBuilder* leditTitleBlockBuilder = mPart->DraftingManager()->TitleBlocks()->CreateEditTitleBlockBuilder(ltitleblocks); -> this line throws exception.

 

Please let me know if anyone already noticed and rectify the same.

3 REPLIES

Re: std:: vector of VS 2013 in NX 9.0 crash

Siemens Phenom Siemens Phenom
Siemens Phenom

 

Good morning.  NX9 requires Visual Studio 11.0 (2012 version) with Update 1.  We do not support the use of the 2013 Studio with NX9.  Please try it with the supported version of the compiler, and if you have any problems, please create an incident report with GTAC so we can investigate.

 

Thanks!

 

Re: std:: vector of VS 2013 in NX 9.0 crash

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

It is possible to use a higher end visual studio development environment as long as the platform toolset is appropriately set to match the requirement for the appropriate version of NX.

 

Image attached.

 

I have had success compiling NX7.5 application using VS2012 and VS2013 just by changing the toolset.

MAYAHTT
www.mayahtt.com

Re: std:: vector of VS 2013 in NX 9.0 crash

Valued Contributor
Valued Contributor

Access violations are almost guaranteed under the following situation:

1. your code uses the debug C/C++ runtime library
2. templated containers are produced on one side and used or destroyed on the other side of the boundary between your code and NX

Reason:
NX 9 uses the release C/C++ runtime library, which is significantly incompatible with the debug version (try calling sizeof() on a std::vector in release and debug mode). My company also encountered this issue, and it went away after making sure that all VS project configurations use the following runtime library, on the advice of a Siemens staff member in one of these forums:

project Property Pages -> Configuration Properties -> C/C++ -> Code Generation -> Runrime Library: Multi-threaded DLL (/MD)