Visual Studio 2008에서 프로젝트를 빌드하려고합니다. 링커 오류가 많아서 정말 귀찮습니다. 내 응용 프로그램은 고유 ANSI C++ 만 사용하는 Win32 콘솔 응용 프로그램입니다.헤더 파일에있는 클래스의 개인 멤버와의 링커 오류
이들은 모두 동일한 패턴의 링커 오류입니다. 링커 오류는 내 자신의 헤더 파일에 정의한 클래스의 모든 단일 개인 정적 데이터 멤버와 관련이 있습니다.
나는 이것이 아마도 C++의 간단한 사실이라고 생각하고 있습니다. 이미 알고 있지 않습니까?
예 : 나는 SingleDelay 멤버 클래스의 함수 정의 내에서 SingleaysDelay의 멤버를 Delays.cpp 파일로 참조합니다. 예 :
SingleDelay::tick(void *output, void *input, int nbufferFrames)<br>{
//.. code here<br>
x = dry * castInput + wet * castInput;<br>
}
오류 38 오류 LNK2001 : 확인되지 않은 외부 기호 "개인 정적 더블 SingleDelay :: 건조"(건조 @ SingleDelay @@ 0NA?) Delays.obj 지연에 SingleDelay의 testall
정의를 .h :
class SingleDelay{
private:
static double dry; //% of dry signal<br>
static double wet; //% of wet signal<br>
static unsigned int delay; //Delay in milliseconds<br>
static int delayCell; //Index in the delayBuffer of the delay to add<br>
static double *delayBuffer; //Delay buffer is 1 second long at sample rate SAMPLE_RATE<br>
static unsigned int bufferCell; //Pointer to the current delay buffer cell<br>
public:
//Tick function
static void tick(void *output, void *input,int nBufferFrames);
//Set and Get functions
static void setSingleDelay(double tDry, double tWet, unsigned int tDelay);
static void setSingleDelay(void);
static void setDry(double tDry);
static void setWet(double tWet);
static void setDelay(unsigned int tDelay);
static double getDry(){ return dry;}
static double getWet(){ return wet;}
static unsigned int getDelay(){ return delay;}
static void initializeDelayBuffer(){
destroyDelayBuffer();
delayBuffer = new double[bufferLength];
}
static void destroyDelayBuffer(){
delete[ ] delayBuffer;
}
};
링크 오류를 나열 할 수 있습니까? –
Yehha, 정확한 링커 오류를 게시하고 싶을 수 있습니다. 그래서 우리는 무엇이 그럴 수 있는지 제안 해 드릴 수 있습니다. –
예, 방금 깨달았습니다. 두 가지 예제 오류와 일부 관련 코드를 추가했습니다. – Rich