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

Windows에서 pthread 사용하기 #65

Open
utterances-bot opened this issue May 27, 2020 · 3 comments
Open

Windows에서 pthread 사용하기 #65

utterances-bot opened this issue May 27, 2020 · 3 comments
Labels
comment Further information is requested

Comments

@utterances-bot
Copy link

Windows에서 pthread 사용하기

pthread 다운

https://wnsgml972.github.io/c/2018/05/07/c_windows_pthread/

Copy link

안녕하세요, 포스팅을 잘 보았습니다. 알찬 내용이었습니다.
위 포스팅과 같이 따라하면," C2011 'timespec': 'struct' 형식 재정의 " 빌드 오류가 나는데, 혹시 이에 관하여 문제를 어떻게 해결하는 것이 좋을까요? 인터넷의 각종 문서를 찾아보고 시도해 보아도 해결이 안 되네요.

@wnsgml972
Copy link
Owner

@OneOfMyClassmate

pthread.h 내의 timespec 구조체와, stdio.h, 혹은 stdlib.h 내의 timespec 구조체가 동일한 이름으로 충돌이 날 수 있다고 합니다.
해결 방법으로 밑에 처럼 코드에 선언하여 중복 구조체 선언을 막는다고 하네요.

#define HAVE_STRUCT_TIMESPEC

https://stackoverflow.com/questions/33557506/timespec-redefinition-error 해당 url을 보시면 좀 더 자세한 설명이 나와있습니다.

@wnsgml972 wnsgml972 added the comment Further information is requested label May 27, 2020
Copy link

네, 그렇군요! 올려주신 url을 참고하여, wnsgml972님의 예제 코드를 성공적으로 빌드하였습니다. 알려주셔서 고맙습니다!

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

No branches or pull requests

3 participants