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

Clang/MacOS compiler error in opc-ua com layer #258

Closed
jwalt opened this issue Oct 7, 2024 · 6 comments
Closed

Clang/MacOS compiler error in opc-ua com layer #258

jwalt opened this issue Oct 7, 2024 · 6 comments
Assignees

Comments

@jwalt
Copy link

jwalt commented Oct 7, 2024

Clang on MacOS (via 4diac-fbe develop branch) fails in the OPC-UA layer:

In file included from /home/jwalter/lcl/4diac-fbe/build/test-macos/forte/build/com/opc_ua/opcua_types.cpp:12:
/home/jwalter/lcl/4diac-fbe/forte/src/com/opc_ua/opcua_helper.h:86:40: error: implicit instantiation of undefined template 'std::vector<const UA_Variant *>'
   86 |         std::vector<const UA_Variant*> mData;
      |                                        ^
/home/jwalter/lcl/4diac-fbe/toolchains/clang-toolchain/SDK/MacOSX11.1.sdk/usr/include/c++/v1/iosfwd:216:28: note: template is declared here
  216 | class _LIBCPP_TEMPLATE_VIS vector;
      |                            ^
In file included from /home/jwalter/lcl/4diac-fbe/build/test-macos/forte/build/com/opc_ua/opcua_types.cpp:12:
/home/jwalter/lcl/4diac-fbe/forte/src/com/opc_ua/opcua_helper.h:100:34: error: implicit instantiation of undefined template 'std::vector<UA_Variant *>'
  100 |         std::vector<UA_Variant*> mData;
      |                                  ^
/home/jwalter/lcl/4diac-fbe/toolchains/clang-toolchain/SDK/MacOSX11.1.sdk/usr/include/c++/v1/iosfwd:216:28: note: template is declared here
  216 | class _LIBCPP_TEMPLATE_VIS vector;
@azoitl
Copy link
Contributor

azoitl commented Oct 7, 2024

@cochicde could youplease have a look on that.

@jwalt
Copy link
Author

jwalt commented Oct 7, 2024

Just as an additional data point: It works fine when using clang for a Linux target. Must be something MacOS specific.

@cochicde
Copy link
Contributor

cochicde commented Oct 7, 2024

I cannot reproduce it locally, but could it be that we are missing a

#include <vector>

In that file?

@jwalt
Copy link
Author

jwalt commented Oct 7, 2024

You should be able to reproduce with:

git clone --recursive -b develop https://github.com/jwalt/4diac-fbe
# download https://github.com/joseluisq/macosx-sdks/releases/tag/11.1 and put it into toolchains subfolder
cd 4diac-fbe
./scripts/compile.sh -v test/test-macos

(the -v flag disables parallel builds but improves error reporting)

@cochicde
Copy link
Contributor

cochicde commented Oct 7, 2024

Thanks. I was able to reproduce and test the fix. See #259

@cochicde
Copy link
Contributor

cochicde commented Oct 8, 2024

closing as #259 was merged and fixes the issue

@cochicde cochicde closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants