2014-09-23 2 views
-1

는 기본적으로 단지 LCD 모듈에 문자를 쓰는 http://ms-iot.github.io/content/16x2LCD.htm테스트 인텔 갈릴레오 예

에서 인텔 갈릴레오에 대한 몇 가지 예제 코드를 실행하려고합니다. LiquidCrystal 라이브러리는 다른 라이브러리의 클래스를 조합하기 때문에 Visual Studio에서 작동하지 않습니다. 클래스 인쇄와 객체 인쇄가 다른 클래스에서 사용되어 합성되기 때문에 기본적으로 나는 C2653과 다른 에러를 얻고있다. 사람은 오류

error C2011: 'Print' : 'class' type redefinition  
      class Print{ 
        private: int write_error;  
    error C2039: 'print' : is not a member of 'LiquidCrystal' 
      lcd.print("Hello!"); 
    error C2504: 'Print' : base class undefined 
      class LiquidCrystal : public Print { public: 
    error C2873: 'write' : symbol cannot be used in a using-declaration, 
      using Print::write; 
    error C2027: use of undefined type 'Print' 
      using Print::write; 
    error C2873: 'write' : symbol cannot be used in a using-declaration 
      using Print::write; 

나는 문제가 인식되지 않는 네임 스페이스와 남용되는 LCD 디스플레이에 쓰기에 대한 인쇄를 사용하여 LCD 클래스 Print.h의 사용으로 인해 생각을 해결하는 방법을 알고.

Print.h가 호출 될 때마다 Print.h가 재정의되지 않도록 LCD 클래스에서 Print 함수를 어떻게 호출 할 수 있습니까?

+0

스택 오버플로에 오신 것을 환영합니다! 오류 외에도 오류의 원인이되는 일부 코드를 포함시켜 사람들이 문제를 좁히는 데 도움이 될 수 있습니다. – Denise

답변

0

http://sixfortyfour.wordpress.com/2014/09/26/displaying-intel-galileo-ip-address-on-a-16x2-lcd/ Print.h 및 Stream.h를 수정 한 빠른 수정 파일은 {Galileo Project Folder} \ packages \ Microsoft.IoT.Galileo.Arduino.1.0.5 \ build \ native \ include에 있습니다. . Print.h를 들어 내가 추가 : Stream.h를 들어

#ifndef _PRINT_H 
#define _PRINT_H 

class Print 
{ 
// Rest of print class 
} 

#endif 

나는 변경 :

enter code here 클래스 스트림 : 공공 인쇄 - 나는 GitHub의 저장소를 확인하고 Print.h가 포함되어

> 클래스 스트림 Stream.h는 여전히 Print ( https://github.com/ms-iot/galileo-sdk/tree/develop/source)에서 상속받습니다.

netduino 프로젝트에 사용한 LCD 구성과 일치하도록 RS, ENABLE, D0, D1, D2, D3도 수정했습니다.

관련 문제