// main.cpp
#include <iostream>
#include <stdlib.h>
#define GO
#ifdef GO
#include "a.h"
#endif
#ifndef GO
#include "b.h"
#endif
using namespace std;
int main(int argc, char *argv[])
{
Something something;
something.doSomething();
system("PAUSE");
return 0;
}
// a.h
class Something
{
public:
void doSomething()
{
printf("included A");
}
};
// b.h
class Something
{
public:
void doSomething()
{
printf("included B");
}
};
DEV-C++에서 테스트했습니다.
대략 잘 작동하는 것 같습니다. VC에서 작동하려면 iostream의 이름에 .h를 붙여주어야 할 듯 싶습니다.
그런데 제가 원하는것은 순수C로 구현하는것입니다
(번거러우시겠지만) dev-c++에서 확인 좀 해주실래요?
VC 링커 문제가 아닌가 싶어서요...