Skip to content

Conversation

@willyborn
Copy link
Contributor

@willyborn willyborn commented Oct 15, 2023

Solves error C7626 when compiling with MSVC 2019 16.6+

Description

See Microsoft C7626 description.

unnamed typedef classes can generate linkage problems. Starting from MSVC 2019 16.6+, error C7626 is generated when compiling with /std:c++17 or above.
Solution: give the typedef a name (I chose KParam_t)

PS: The linkage problem also exists with GCC and Clang (see P1766R1.)

Changes to Users

None

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • Functions added to unified API
  • Functions documented

@ytian-xxxxxxxx
Copy link

It seems the typedef grammar of KParam is not C++ style, after I change to the following code, the build succeeded.
struct KParam {
dim_t dims[4];
dim_t strides[4];
dim_t offset;

#ifndef OPENCL_VERSION
dim_t *dims_ptr() { return dims; }
dim_t *strides_ptr() { return strides; }
#endif
};

@christophe-murphy christophe-murphy merged commit efec9b0 into arrayfire:master Nov 6, 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

Successfully merging this pull request may close these issues.

3 participants