error on Myns with "UaModeler" in C++

Questions regarding the use of UaModeler

Moderator: uamodeler

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

error on Myns with "UaModeler" in C++

Post by kp85 »

hi,I want to run the example set in uasdkcppbundle-EVAL-bin-win32-x86-v1.3.0-183-vs2008sp1 I board but this error
Myns::NodeManagerexempleNameSpaceName* pNM = new Myns::NodeManagerexempleNameSpaceName;
pServer->addNodeManager(pNM);
Last edited by kp85 on 07 Feb 2013, 10:48, edited 1 time in total.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Hi kp85,

the lines of code seem to be correct, here I can't see any error. If you exactly follow the example and the documentation in the tutorial, than it will work just fine.

Please be more precise on exactly the error you experienced.

Best regards,
Unified Automation Support Team
Last edited by Support Team on 07 Feb 2013, 10:48, edited 1 time in total.
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

hi
I board followed the example to the letter and it gives me this error


Erreur 1 error C2248: 'MyNs::NodeManagerexampleNamespaceName::NodeManagerexampleNamespaceName' : impossible d'accéder à private membre déclaré(e) dans la classe 'MyNs::NodeManagerexampleNamespaceName' C:Program Files (x86)UnifiedAutomationUaSdkCppBundleEvalexamplesserver_hello_worldservermain.cpp 63
Last edited by kp85 on 07 Feb 2013, 10:48, edited 1 time in total.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Hi kp85,

the default constructor was changed to be private. The example is still on the old code. Please change the lines of code as followes:

MyNs::NodeManagerexampleNamespaceName* pNM = new MyNs::NodeManagerexampleNamespaceName(false);
pServer->addNodeManager(pNM);

This will force the compiler to use the public constructor.

We will change the example documentation with the next release of the UaModeller. Thanks for reporting this issue.

best regards
Support Team
Last edited by Support Team on 07 Feb 2013, 10:48, edited 1 time in total.
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

thank you for the other error now when I compile I get this error


Erreur 4 error LNK2001: symbole externe non résolu \"__declspec(dllimport) public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)\" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) C:Program Files (x86)UnifiedAutomationUaSdkCppBundleEvalexamplesserver_hello_worlduamoduled.lib(uatransactionmanager.cpp.obj)


can you help me please !!
Last edited by kp85 on 07 Feb 2013, 10:48, edited 1 time in total.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Hi kp85,

the example works fine on my machine without any unresolved externals.
I need to know the following things:

1) What kind of Visual Studio are you using?
2) Can you compile the example without any modification (without files generated by UaModeler)?
3) Have you edited any other things than the code in the example?

best regards
Support Team
Last edited by Support Team on 07 Feb 2013, 10:48, edited 1 time in total.
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

1)visual studio 2010
2) YES but i have same error
3)NO
thanks
Last edited by kp85 on 07 Feb 2013, 10:48, edited 1 time in total.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Hello kp85,

thank you for your reply that makes things really clear.
As described in the readme.txt the binary version (eval) was built with Visual Studio 2008 sp1 and so the examples also can only be compiled with this version of Visual Studio. If you mix two versions of VS you will get linker errors or even worse, crashes at runtime. You should never mix two versions of c-runtimes.
To solve your problem, please install Visual Studio 2008 sp1 and try to compile again.

best regards
Support Team
Last edited by Support Team on 07 Feb 2013, 10:48, edited 1 time in total.
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

thanks but where can i have Visual Studio 2008 sp1 to intall because i found it but i can't install!!

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Did you install VS 2008 first and then try to install SP1? You can't install SP1 for VS 2008 if you have VS 2010 installed only. Which error message did you get when you tried to install the service pack?
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

i have this message

VC Libraries QFE Patch ne s'applique pas ou est bloqué par une autre condition du système. Cliquez sur le lien ci-dessous pour plus d'informations.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

The solution we deliver only works with VS 2008 SP1. If you have problems installing VS 2008 with SP1 you have to contact the microsoft support.
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

but can i use vs2010 ?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re:error on Myns with "UaModeler" in C++

Post by Support Team »

Please read the post #136 again.

In principle it is possible to build the SDK with VS 2010, but the evaluation version of the SDK you have downloaded was built with VS 2008 SP1, so all libraries have dependencies to the c-runtime of VS 2008 SP1, hence it is NOT possible to build the examples with VS 2010 and link them against the VS 2008 sp1 built libraries. Also all third-party products (like openssl and libxml2) were built with VS 2008 SP1.
If you want to build your generated code and the examples (e.g. server_hello_world) with VS 2010 you have to rebuild ALL libraries located in folder lib and the third-party files with this Visual Studio. But it is not possible to rebuild the libraries without the source files, which are not delivered in the evaluation product of the SDK.
The only solution to your problem is to install the Visual Studio 2008 with SP1 and build your code again.

To get an overview about all Microsoft Visual Studio products and their compiler please read this: http://en.wikipedia.org/wiki/Microsoft_Visual_Studio
Best regards
Unified Automation Support Team

kp85
Sr. Member
Sr. Member
Posts: 16
Joined: 02 Sep 2011, 19:30

Re:error on Myns with "UaModeler" in C++

Post by kp85 »

thank you for your help !but how i can get the sources files if its possible

Post Reply