Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Building demo projects with c++ 20 don't compile

More
23 Nov 2021 10:32 #10381 by support
Hello.

I also get the warning:

Native\SDK\include\QuickOpc.h(19,1): warning C4279: 'or': identifier in type library 'BED7F4EA-1A96-11D2-8F08-00A0C9A6186D' is a keyword; use the 'rename' qualifier

So, this tells me what to do: In the QuickOpc.h file, I replaced
#define IMPORT_MSCORLIB "libid:BED7F4EA-1A96-11D2-8F08-00A0C9A6186D"
with
#define IMPORT_MSCORLIB "libid:BED7F4EA-1A96-11D2-8F08-00A0C9A6186D" \
	rename("or", "or1")
This resolves both the warning and the errors.

We will include this change with the next QuickOPC version. Thank you for reporting it.

Best regards

Please Log in or Create an account to join the conversation.

More
22 Nov 2021 14:43 - 23 Nov 2021 07:57 #10374 by Erik
Hello,

I am trying to build the demo project for C++. With C++14 and C++ 17 the projects are building.
I have tried to build the software with version 2018.3 and with the newest version 2021.3.
I have changed the setting in the properties for the project:
Configuration properties
--> Generial
--> C++ Language Standard (ISO C++20 Standard (/std:c++ 20)

But with C++20 the projects are not building. See below for the output for the project RandomReads:


Severity Code Description Project File Line Suppression State
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14554
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14554
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14557
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14557
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14567
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14567
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14570
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14570
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2059 syntax error: '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2059 syntax error: ')' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14554
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14554
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14557
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14557
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14567
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14567
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14570
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14570
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2143 syntax error: missing ';' before '{' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2143 syntax error: missing ')' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2143 syntax error: missing ';' before '||' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2143 syntax error: missing ';' before '{' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2238 unexpected token(s) preceding ';' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14554
Error C2238 unexpected token(s) preceding ';' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14557
Error C2238 unexpected token(s) preceding ';' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14567
Error C2238 unexpected token(s) preceding ';' RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tlh 14570
Error C2447 '{': missing function header (old-style formal list?) RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2447 '{': missing function header (old-style formal list?) RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302
Error C2761 'HRESULT mscorlib::ITrackingHandler::MarshaledObject(const _variant_t &,mscorlib::_ObjRef *)': redeclaration of member is not allowed RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2296
Error C2761 'HRESULT mscorlib::ITrackingHandler::UnmarshaledObject(const _variant_t &,mscorlib::_ObjRef *)': redeclaration of member is not allowed RandomReads C:\Program Files (x86)\OPC Labs QuickOPC 2021.3\Examples-COM\CPP\VS2019\Win32\RandomReads\x64\Debug\mscorlib.tli 2302

So is it possible to create/build projects with C++ 20?
Last edit: 23 Nov 2021 07:57 by Erik.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.052 seconds