Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: multiple assignment operators specified. #245

Open
AIVASteph opened this issue May 26, 2021 · 1 comment
Open

Error: multiple assignment operators specified. #245

AIVASteph opened this issue May 26, 2021 · 1 comment

Comments

@AIVASteph
Copy link

AIVASteph commented May 26, 2021

Forgive me if this is a noob question, but I haven't used C++ much in the last 9 or so years so I've forgotten a lot of it's nuances.

I'm trying to include a built version of this library into UE4. I've successfully downloaded and built the library and included it in my UE4 project (which seems to be linking correctly). When building the UE4 files however I get the following errors:

2>  [10/15] SerialPlugin.gen.cpp
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(620): error C4522: 'serial::Serial': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(640): error C4522: 'serial::SerialExecption': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(673): error C4522: 'serial::IOException': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(653): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>  C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\string.h(181): note: see declaration of 'strerror'
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(693): error C4522: 'serial::PortNotOpenedException': multiple assignment operators specified
2>  [11/15] SerialPlugin.cpp
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(620): error C4522: 'serial::Serial': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(640): error C4522: 'serial::SerialExecption': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(673): error C4522: 'serial::IOException': multiple assignment operators specified
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(653): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>  C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\string.h(181): note: see declaration of 'strerror'
2>D:\UE4\CPPSerial\Plugins\SerialPlugin\Source\ThirdParty/Serial/serial.h(693): error C4522: 'serial::PortNotOpenedException': multiple assignment operators specified

I don't know what version of gcc UE4 is using (I'm assuming it's using gcc) but I wouldn't be surprised if it was using an old version of the C++ standard. Do I need to compile the library with some different compiler settings to make these errors go away? Or do I need to alter the source files to remove the extra assignment operators?

All input appreciated!

@wjwwood
Copy link
Owner

wjwwood commented Jun 10, 2021

Hmm, this was originally written against C++03, so I'd be surprised if it is a gcc version issue. That output actually looks like MSVC (not gcc or clang).

According to this: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4522?view=msvc-160

Those are warnings, not errors, so maybe you have "warnings as errors" enabled at some level? I'm not even sure this is a warning that should be fixed, but maybe I can investigate it eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants