기본 콘텐츠로 건너뛰기

g++ STL error: expected unqualified-id before '(' token

/usr/lib/gcc/blarblar.../c++/4.x.x/bits/blarblar.tcc:xxx: error: expected unqualified-id before '(' token
STL 프로그래밍 하면서 제일 짜증났던 오류메시지였다. 뭔가 내가 잘못한 것이라고 생각했는데, std::min/std::max 템플릿 함수와 매크로함수 min/max가 겹치면서 발생한 문제라는군.

#ifdef min
#   undef min
#endif
#ifdef max
#    undef max
#endif


대충 이렇게 해결.

댓글

이 블로그의 인기 게시물

Winget 해시 무시하기

가끔씩 Winget 에서 패키지를 다운로드 했을 때, "설치 관리자 해시가 일치하지 않습니다." 오류가 뜰 때가 있다. 보안 이슈가 있지만, 그냥 무시하고 싶을 때, 아래 순서로 무시해준다. 관리자 권한 winget settings --enable InstallerHashOverride 설치 winget install --ignore-security-hash --id NirSoft.NirCmd