How do I compile sources downloaded from the internet?

Started by
5 comments, last by beast911 17 years, 10 months ago
I have a few open sources that I have downloaded and I am wondering how do I compile them. I am using Microsoft Visual C plusplus 6.0 and I get tons of errors every time I try to. I create a new Win32 Console Application project and then I add the source files to the project. I then try to compile or build them, but it fails every time with like 20 to 50 errors. It looks like these are C plusplus files and that they do work since other people can comment about them. I have tried searching, but I can't find anything on this. A push in the right direction would be appreciated.
Advertisement
Perhaps you should tell us what source code you downloaded and what the errors are (all of them).

All I can tell you right now is that VC6 is outdated. You can get Visual C++ 2005 Express Edition freely from here. (Make sure you read this as well, if you plan on writing Win32 applications)


jfl.
Are those projects command line programs?
I guess if they are not then you might need to add some libraries to the linker.
Try creating a Win32 GUI Application, if there is any code created automatically delete it and then add the sources to the project.

Post the errors you get if that doesn't work. We need more to go on then.
Writing errors since 10/25/2003 2:25:56 AM
Ok, I switched to VC 2005 and I installed the Platform SDK and updated the paths. I tried the new project from existing code and went through the process, but I still get these errors.

1>Compiling manifest to resources...
1>Linking...
1>libcmtd.lib(fpinit.obj) : error LNK2005: __fltused already defined in a previous module
1>libcmtd.lib(fpinit.obj) : error LNK2005: __ldused already defined in a previous module
1>libcmtd.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(_ctype.obj) : error LNK2005: _isalpha already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(_ctype.obj) : error LNK2005: _islower already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(_ctype.obj) : error LNK2005: _isdigit already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
1>libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
1>libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
1>libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
1>libcmtd.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(vsprintf.obj) : error LNK2005: _vsprintf already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR80D.dll)
1>libcmtd.lib(ismbbyte.obj) : error LNK2005: __ismbblead already defined in MSVCRTD.lib(MSVCR80D.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'libcmtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcmtd.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
32 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Looks like that your code uses another runtime library. Check out against what runtime library (single or multithreaded) is used in the code and adjust the settings of your application to that. Perhaps that solves your problem.

Crafter 2D: the open source 2D game framework

?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

Again, it would probably help if you told use what it is you are trying to compile, and in what form you got it.

I agree with jeroenb, it looks like a runtime library conflict. However, I'm surprised that this would arise if this is a project that you are compiling from source, and not a library file that has already been compiled. [edit] Are these the same errors that you were getting before? If not, then try a Build->Clean Solution.

Also, it shouldn't be a console application, apparently, as the last error message testifies to. Go to Project->Properties->Configuration Properties->Linker->System->SubSystem and set it to Windows (this should only solve the last error).


jfl.
I went into the runtime library and changed it from Multi-threaded Debug DLL (/MDD) to Multi-threaded Debug (/MTd) and now it works perfectly. Thanks for the help.

This topic is closed to new replies.

Advertisement