Jump to content
  • Advertisement
Sign in to follow this  
beast911

How do I compile sources downloaded from the internet?

This topic is 4406 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ==========

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!