Skip to content

为实例添加强制类型转换以解决报错 #6

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

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

CaFeZn
Copy link
Contributor

@CaFeZn CaFeZn commented Jul 9, 2025

源实例的t.Creat函数的第一个参数ArgType要求为(void*)
典型用法中给出的是int arg;
但函数要求void *类型,不添加强制类型转换在此处编译会报错

no matching member function for call to 'Create'GCC thread.hpp(64, 8): candidate template ignored: deduced conflicting types for parameter 'ArgType' ('int *' vs. 'void *') ”

源实例的t.Creat函数的第一个参数ArgType要求为(void*)
典型用法中给出的是int arg;
但函数要求void *类型,不添加强制类型转换在此处编译会报错
“
no matching member function for call to 'Create'GCC thread.hpp(64, 8): candidate template ignored: deduced conflicting types for parameter 'ArgType' ('int *' vs. 'void *')
”
@Jiu-xiao Jiu-xiao merged commit aa904dc into xrobot-org:XRobot2.0 Jul 10, 2025
@Jiu-xiao
Copy link
Collaborator

不对啊,你是不是线程函数的参数写成这样了:

void Blink(void* arg) {
  ...
}

@CaFeZn
Copy link
Contributor Author

CaFeZn commented Jul 15, 2025

不对啊,你是不是线程函数的参数写成这样了:

void Blink(void* arg) {
  ...
}

草,确实,默认线程参数是void*
我的问题

@CaFeZn CaFeZn deleted the patch-1 branch July 15, 2025 07:26
@CaFeZn CaFeZn restored the patch-1 branch July 15, 2025 07:26
@CaFeZn CaFeZn deleted the patch-1 branch July 15, 2025 07:27
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.

2 participants