Advertisement

Damn compiler linker errors: fatal error LNK1169

Started by July 23, 2001 07:12 PM
2 comments, last by stevenmarky 23 years, 6 months ago
I was happily programming a small DX game in VC++, when all of a sudden the next time I try to compile it, I get a linker error: Debug/CreateDevice.exe : fatal error LNK1169: one or more multiply defined symbols found I looked in MSVC, and found a little info on the error, here it is: Linker Tools Error LNK2005 symbol already defined in object The given symbol, displayed in its decorated form, was multiply defined. Tips One of the following may be a cause: The most common cause of this error is accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions. The given symbol was a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include the symbol. The given symbol was defined differently in two member objects in different libraries, and both member objects were used. An absolute was defined twice, with a different value in each definition. This error is followed by fatal error LNK1169. Linker Tools Error LNK1169 one or more multiply defined symbols found The build failed due to multiple definitions of one or more symbols. This error is preceded by error LNK2005. The /FORCE or /FORCE:MULTIPLE Syntax /FORCE:{MULTIPLE|UNRESOLVED} This option tells the linker to create a valid .EXE file or DLL even if a symbol is referenced but not defined or is multiply defined. On the command line, the /FORCE option can take an optional argument: Use /FORCE:MULTIPLE to create an output file whether or not LINK finds more than one definition for a symbol. Use /FORCE:UNRESOLVED to create an output file whether or not LINK finds an undefined symbol. A file created with this option may not run as expected. The linker will not link incrementally when the /FORCE option is specified. To find this option in the development environment, click Settings on the Project menu. Then click the Link tab, and click Customize in the Category box. I have been unable to find the cause of the error, and anyway what is a: 1. absolute 2. multiply defined symbol 3. single-threaded and multithreaded libraries please can you help me out? Is their a easy way to find out what the cause is? ect
how do you link your project together? how many headers and source files? a usual cause of this error is if you define the same include in several different source files.

you can use

#ifndef SOME_HEADER_H
#define SOME_HEADER_H

//header stuff here

#endif


so that if this header is included in another source file, it will not conflict with the first source file that referenced this header.

a2k

Edited by - a2k on July 23, 2001 8:28:13 PM

Edited by - a2k on July 23, 2001 8:28:35 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Advertisement
I eventually figured it out, thanks for the help..
It was my globals for some reason, specifically two integers, though I still don''t understand why it decided they were errors after I had been using them for so long......?
if you hit F7 (Build) that just compiles the source that has been changed. There may have been a case where you added an identical variable, but did not recompile the entire project with Rebuild All. It''s just a guess, but usually you can Build projects and still eventually run into linker issues if you don''t build the entire project. Not sure if this was your problem, but this may be the reason.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k

This topic is closed to new replies.

Advertisement