|
프로그램을 하시느라 다들 고생 많으십니다.
6.0 기반이구요
기본 폼 하나에 폼 하나를 추가로 만들었습니다.
Main 과 comport라고 명명 했습니다.
comport에 헤더는
//---------------------------------------------------------------------------
#ifndef ComPortH
#define ComPortH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TSetup : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TSetup(TComponent* Owner);
};
int Command; //<<< 추가 하였습니다.
//---------------------------------------------------------------------------
extern PACKAGE TSetup *Setup;
//---------------------------------------------------------------------------
#endif
그러고 나서
다른 작업없이
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "fMain.h"
#include "ComPort.h" //<<<<<이부분입니다.
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMain *Main;
//---------------------------------------------------------------------------
__fastcall TMain::TMain(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
위와 같이 fMain.cpp에 추가 기입하였습니다.
그러고나서
[Linker Warning] Public symbol '_Command' defined in both module D:\TESTCLASS\FMAIN.OBJ and D:\TESTCLASS\COMPORT.OBJ
에러 입니다.
무엇이 문제인지 도움 부탁드립니다.
가장 기본적인거이긴한데
저의 개념으로 헤더에 선언 cpp에서 인클루드...
하면 끝인데... ㅜㅜ
창피한일인건 알지만 알몸으로 덤벼 봅니다. 따끔한 조언 부탁합니다.
|