简体   繁体   English

Embarcadero和免费OPA UA

[英]Embarcadero and free opc ua

I'm trying to get an app working with a PLC. 我正在尝试让一个与PLC一起工作的应用程序。 I'm using this library: https://github.com/FreeOpcUa/freeopcua 我正在使用这个库: https : //github.com/FreeOpcUa/freeopcua

example code: https://github.com/FreeOpcUa/freeopcua/blob/master/src/examples/example_client.cpp 示例代码: https : //github.com/FreeOpcUa/freeopcua/blob/master/src/examples/example_client.cpp

But when I include the header files(like in the example) from the library it gives an error: 但是,当我包含库中的头文件(如示例中的头文件)时,会出现错误:

Non-Virtual function 'DateTime::DateTime(const DateTime &)' declared pure. 非虚拟函数'DateTime :: DateTime(const DateTime&)'声明为纯。

When I search the specific line of this error it shows me this: 当我搜索此错误的特定行时,它会向我显示以下内容:

    DateTime(const DateTime&) = default;

I already asked it on the github page, and they are saying it has something to do with my compiler. 我已经在github页面上问过了,他们说这与我的编译器有关。 I never touched it, so it shouldn't be having odd options. 我从没碰过它,所以它不应该有奇怪的选择。

So how can I solve this? 那么我该如何解决呢? And if there is something wrong with my compiler, How can I change my compiler options to get it fixed? 如果我的编译器出问题了,如何更改我的编译器选项来修复它?

在此处输入图片说明

Yes, bcc32 don't allow to create instance of abstract class. 是的,bcc32不允许创建抽象类的实例。 So you can change target platform to win64 and compile without errors. 因此,您可以将目标平台更改为win64并进行编译而不会出现错误。

Another way, as Thorsten Schöning said, you can use C++ Builder 10 with bcc32c based CLANG compiler and do it also without errors. 正如ThorstenSchöning所说的那样,您可以将C ++ Builder 10与基于bcc32c的CLANG编译器一起使用,并且也不会出错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM