OMG What happend?
1>------ Build started: Project: Trainer, Configuration: Debug Win32 ------
1>Build started 9/8/2012 3:19:37 PM.
1>PrepareForBuild:
1> Creating directory "c:\users\admin\documents\visual studio 2010\Projects\Trainer\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\Trainer.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> dllmain.cpp
1> Trainer.cpp
1>Trainer.obj : error LNK2005: _DllMain@12 already defined in dllmain.obj
1>c:\users\admin\documents\visual studio 2010\Projects\Trainer\Debug\Trainer.dll : fatal error LNK1169: one or more multiply defined symbols found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:06.15
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Code:
// Trainer.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#define ADDR_GM 0x1076C40
#define ADDR_AOE 0x10C730C
#define ADDR_RANGE 0x10C7308
void Start();
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ulReason, LPVOID lpReserved)
{
if (ulReason == DLL_PROCESS_ATTACH)
{
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Start, 0, 0, 0);
}
return TRUE;
}
void Start()
{
while (1)
{
if (GetKeyState(VK_F12) < 0) // Turn On
{
*(DWORD*)ADDR_GM = 2;
*(DWORD*)ADDR_AOE = 100;
*(DWORD*)ADDR_RANGE = 13;
}
if (GetKeyState(VK_F11) < 0) // Turn Off
{
*(DWORD*)ADDR_GM = 0;
*(DWORD*)ADDR_AOE = 0;
*(DWORD*)ADDR_RANGE = 0;
}
Sleep(1);
}
}
What should I do?