- This topic has 6 replies, 4 voices, and was last updated 5 years, 10 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] BoxROI in cpp
Tagged: 64_bits, SOFA_1712, Windows_10
Hi,
I would like to use BoxROI component in cpp. I write :
sofa::component::engine::BoxROI<sofa::defaulttype::Vec6dTypes>::SPtr boxr= sofa::core::objectmodel::New<sofa::component::engine::BoxROI<sofa::defaulttype::Vec6dTypes>>();
but I am getting unresolved externals which are maybe because of the wrong type(Vec6dTypes).
The problem is that I can not use the constructor with :
defaulttype::Vec<6,Real> Vec6
because I don’t have : DataTypes::Real .
How can I fix this?
I am working in Main.cpp of runSofa project.
Thank you,
Harris
Dear @hkomninos
you can create smart pointer for BoxROI component with below code ::
HEADER FILE
#include <sofaEngine/BoxROI>
typedef sofa::component::engine::BoxROI<sofa::defaulttype::Vec6dTypes> BoxROI;
CPP FILE
BoxROI::SPtr bROI = sofa::core::objectmodel::New<BoxROI>();
bROI->init();
Best,
Behnam Binesh
Hi Harris,
Could you post the link errors from your compilation output?
Hi,
the errors are:
LNK2001 Error unresolved external symbol “public: virtual class sofa::core::objectmodel::BaseClass const * __cdecl sofa::component::engine::BoxROI<class sofa::defaulttype::StdVectorTypes<class sofa::defaulttype::Vec<6,double>,class sofa::defaulttype::Vec<6,double>,double> >::getClass(void)const
etc..
Thank you,
Harris
Hi Binesh,
I solved my problem.
I realize that I had written in the include:
SofaGeneralEngine/BoxROI.h
Sorry, my mistake.
Thank you for your time,
Harris
Good @hkomninos , and thanks @secretdevil.
Harris, do not hesitate to set yourself a forum status to “[SOLVED]” when the discussion is over.
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.