2014-09-26 1 views
-2

MS Visual Studio에서 W59Components.cpp (콘솔) 및 Frequency.cpp (DLL)라는 두 개의 개별 프로젝트를 만들었습니다. W59Components> ReadFile.h에서 ReadFile 클래스를 만들고 다른 MS 프로젝트 Frequency.cpp에서 해당 클래스를 사용하려고합니다. 나는 운이없는 화제에 다른 공개 토론을 보았다.C++ MS Visual Studio Exp 2013 IntelliSense :이 선언에는 저장소 클래스 또는 형식 지정자가 없음

어떤 이유로 IntelliSense 오류가 발생합니다. "IntelliSense :이 선언에는 저장소 클래스 나 형식 지정자가 없습니다."

컴파일러 오류 :

오류 C2146 : 구문 오류 : 누락 ';' 식별자 't'앞에

오류 C4430 : 누락 된 형식 지정자 - 가정합니다. 참고 : C++은 default-int를 지원하지 않습니다.

오류 C2365 : 'ReadFile': 재정의; 이전의 정의는 '기능'의

참조 선언했다 'ReadFile을'여기

코드의 조각이다 : 당신은 비주얼 다른 MS에서 헤더 파일을 #include를 어떻게

#include "stdafx.h" 
#include <windows.h> 
#include <string> 
#include "../../scripts/DLLs/Wave59_SDK.h" 
using namespace std; 

#include "ReadFile.h" 
ReadFile t;  // Should Reconize "ReadFile" as a class 

//#include "../../scripts/DLLs/demo/Demo.h" 

// --------------------------------------------------------------------------- 

extern "C" double __declspec(dllexport) average(WAVE59_DATASTRUCT *price_ptr, 
    int currentptr, int *int_args, int num_int_args, double *double_args, 
    int num_double_args, char **string_args, int num_string_args); 

스튜디오 프로젝트? 여기

헤더 파일, 난 함수 정의에 부담을 싶지 않았다

/* ReadFile.h 
* Reads a incomming file and splits it into a multidemensional array */ 

# include <istream> 
# include <fstream> 
#include<string> 
using namespace std; 

class ReadFile { 
public: 
    ReadFile(){}; 
    ~ReadFile(){}; 

    void ReadTheFile(string path = "C:\\Users\\Owner\\Documents\\Wave59\\TestWriteFile.txt"); 
    void split(string delimiter, string text, string pArray[]); 
    int getColumnNum(){ return this->columnNum; } 
    int WriteFile(string message[], int lenMessage, string path = "C:\\Users\\Owner\\Documents\\Wave59\\W59Components-WrittenFile.txt"); 

    double f2Array[20][1000]; 

private: 
    void readFile(double pArray[], string path = "C:\\Users\\Owner\\Documents\\Wave59\\TestWriteFile.txt"); 
    void sortArray(double returnArray[], int modNum); 

    // Initalize VARS 
    const int SIZE = 10000; 
    double fArray[10000];  // file data 
    int columnNum;      // Number of colums in the file data, which is different arrays of data 
}; 
+0

*** 다른 MS Visual Studio 프로젝트에서 헤더 파일을 # 포함하는 방법은 무엇입니까? *** 일반적으로 추가 포함 디렉토리에 경로를 추가합니다. 그러나 당신이 그것을 포함하는 방식은 괜찮을 것입니다. Visual Studio에서 헤더를 찾을 수 없으면 다른 오류가 발생했을 것이므로 괜찮습니다. 아마도 #ifdef 가드가 ReadFile.h에 문제가있을 수 있습니다. – drescherjm

+1

'ReadFile.h'의 내용을 보여줘야합니다. –

+2

정확한 컴파일러 오류도 도움이됩니다. Intellisense 오류는 항상 컴파일러 오류가 아닙니다. – drescherjm

답변

관련 문제