我正在尝试使用 2000 年代初期的源代码编译应用程序,我模仿了开发环境,但是在编译这个名为“xserver”的应用程序时,我似乎无法克服“致命错误 LMK1169:一个或多个相乘找到定义的符号。” 它告诉我该文件是我正在处理的项目,非常有帮助。幸运的是,我正在编译的项目不是很大,所以我相信已经确定了导致问题的源文件。
#include "floop.h"
#include "ftext.h"
#include "fvid.h"
#include "fxfm.h"
#include "faudio.h"
#include "fpadio.h"
#include "fdraw.h"
#include "frenderer.h"
#include "fperf.h"
#include "dx/fserver.h"
#include <xtl.h>
#include <XbDm.h>
static BOOL _ServerInit(void *pParameter)
{
// floop_EnableGovernor( TRUE );
return TRUE;
}
static void _ServerTerm( FLoopTermCode_t nTermCode, void *pParameter )
{
}
static BOOL _ServerMain( BOOL bExitRequest, void *pParameter )
{
return !bExitRequest;
}
int main(int argc, char *argv[])
{
fang_Init();
//Fang_ConfigDefs.pszFile_MasterFilePathName = "d:\\mettlearms_xb.mst";
if (!fang_Startup())
{
// Trouble starting up Fang...
OutputDebugString( "Could not start up Fang :(\n" );
DmReboot( DMBOOT_WARM );
for(;;);
}
if (!fserver_GraphicsStartup())
{
DEVPRINTF("failed graphics\n");
DmReboot( DMBOOT_WARM );
for(;;);
}
FPerf_nDisplayPerfType = FPERF_TYPE_NONE;
fserver_SetTakeover(TRUE);
floop_InstallGameloop(_ServerInit, _ServerMain, _ServerTerm, 0, 60, 15);
DmReboot(DMBOOT_WARM);
for(;;);
return 0;
}
任何建议或提示将不胜感激!❤ 这是它吐出的构建日志
Compiling...
main.cpp
Linking...
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _printf already defined in LIBC.lib(printf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _fflush already defined in LIBC.lib(fflush.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _malloc already defined in LIBC.lib(malloc.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _tolower already defined in LIBC.lib(tolower.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
.\Release/xserver.exe : fatal error LNK1169: one or more multiply defined symbols found