간단한 테스트용 클래스를 만드는데  vector때문에 컴파일 에러가 발생했다.


error C2143: 구문 오류 : ';'이(가) '<' 앞에 없습니다.

error C4430: 형식 지정자가 없습니다. int로 가정합니다. 참고: C++에서는 기본 int를 지원하지 않습니다.

error C2238: ';' 앞에 예기치 않은 토큰이 있습니다.


헤더 선언 [#include <vector>] 및 네임스페이스 선언 [using namespace std;]는 미리 컴파일된 헤더[stdafx.h]에 추가해두었기 때문에

정상적으로 컴파일이 되어야 했으나 그러지 못했다.


짐작되는 원인으로는,

openCV라이브러리를 사용하고 있는데 이 라이브러리 내부의 네임스페이스와 겹치거나 하는 일이 생기는 듯 하다.



vector 선언에 네임스페이스를 명시해주니 문제가 해결되었다.

  --> std::vector<PCTYPE> m_ticks;



header


#pragma once

#define PCTYPE		__int64

class PerformCheck
{
private:
	PCTYPE m_lastTick;
	PCTYPE m_currentTick;

	vector<pctype> m_ticks;   // a compile error occurred here. attach "std::"

public:
	PerformCheck();
	~PerformCheck();

public:
	// Add current tick count to the queue with incremental index.
	// @return: elapsed time from last call to current call
	PCTYPE AddCheck();

	PCTYPE GetElapsed(const unsigned int& idxFrom, const unsigned int& idxTo);

	inline
	void Clear()
	{
		m_ticks.clear();
		m_lastTick = cvGetTickCount();
	}
};


Posted by Kugi
,