0

I am attempting to compile an application using source code from the early 2000s, I have mimicked the development environment however when it comes to compiling this one application called "xserver", I cannot seem to get past "fatal error LMK1169: one or more multiply defined symbols found." with it telling me that the file is the project I'm working on, very helpful. Luckily, the project I'm compiling isn't very large so I believe have determined the source file causing the issue.

#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;
}

Any suggestions or tips would be extremely appreciated! ❤ Here's the build log it spits out

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
463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185
VPGxxx
  • 9
  • 3
  • "one or more multiply defined symbols found" is not very helpful. There must be more information in the error message, please include the complete message in the question – 463035818_is_not_an_ai Jul 31 '20 at 10:17
  • I understand it's not very helpful, that's why I'm having so many issues with it, thats all the Task List shows me when it error's out https://i.imgur.com/6MFJquG.png – VPGxxx Jul 31 '20 at 10:18
  • forget about the tasklist and look at the compilers output, I dont know the IDE you are using so I cannot tell you where to find it, but for error messages you should always directly look at the error, not at the stripped message from your IDE – 463035818_is_not_an_ai Jul 31 '20 at 10:20
  • This is the build log it spits out once it's finished https://i.imgur.com/zrXZ04Q.png – VPGxxx Jul 31 '20 at 10:23
  • images are not really useful. You should copy that complete error message and include it in the question – 463035818_is_not_an_ai Jul 31 '20 at 10:25
  • just added it! let me know if that helps. – VPGxxx Jul 31 '20 at 10:29
  • if the formatting was intentional, you can revert my edit. Yes better, thats an error message now. – 463035818_is_not_an_ai Jul 31 '20 at 10:35

2 Answers2

0
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

Are you mixing different runtime library types?

MaAlonsoA
  • 11
  • 7
  • Possibly? It's an ancient piece of software with all kinds of different requirements. – VPGxxx Jul 31 '20 at 10:42
  • I don't know what IDE are you using. In Visual Studio you can determine it in Property > C/C++ > Code Generation > Runtime Library. Make sure all your source code is the same configuration. For example, if you have some old libs compiled in DLL/MD you must have all your source code in the same mode – MaAlonsoA Jul 31 '20 at 10:52
0

Problem solved. Was mixing different runtime lib types.

VPGxxx
  • 9
  • 3