LNK1169: one or more multiply defined symbols found

LNK1169: one or more multiply defined symbols found

I'm trying to compile Firefox for Windows using the Intel compiler. I've managed to compile everything fine up until this point:
http://i44.tinypic.com/3010vue.png
From what I've gathered/been told, multiple copies of the CRT are being linked. I've tried setting the library to be used as the one given in -LIBPATH:C:\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\intel64
but MINGW32 doesn't deal well with spaces and keeps returning errors.
So that didn't work. I'm not quite sure what else I can do?
If it helps I'm using the 30 day trial of Intel Composer XE 2011 SP1 Update 7.

47 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Use the short-name for "Composer XE 2011 SP1" instead.

To find the short name for it, open a cmd prompt, use cmd "dir /X". It will list the short-name for it similar to "COMPOS~2"

Jennifer

Quoting Jennifer Jiang (Intel)
Use the short-name for "Composer XE 2011 SP1" instead.

To find the short name for it, open a cmd prompt, use cmd "dir /X". It will list the short-name for it similar to "COMPOS~2"

Jennifer

Well it accepted it but it still didn't fix the error.

please post the compiling and link options, as well as some of the errors.

Jennifer

mozconfig:
http://pastebin.com/PsvWvscP
config.log:
pastebin.com/23MKbVT2
The new error:
http://i42.tinypic.com/15q9imc.png

When I don't use LIBPATH I get the same error as before.

ok. I saw the original errros.

When compiling with icl, add /MD to the options if it's for release build. If it's for debug build, use /MDd. the default is /MT if you do not specify it.

you should not need to add "libpath" option at link.

Jennifer

Quoting Jennifer Jiang (Intel)
ok. I saw the original errros.

When compiling with icl, add /MD to the options if it's for release build. If it's for debug build, use /MDd. the default is /MT if you do not specify it.

you should not need to add "libpath" option at link.

Jennifer

Well when I use the -MD flag, I get the new error:

http://i42.tinypic.com/15q9imc.png

I was looking at the OpenMP library, and it says that on GCC/Microsoft compilers you need to put the headers in a separate folder and use then link to them? Could that possibly be the cause of the error here?

http://software.intel.com/sites/products/documentation/hpc/composerxe/en...

Be aware that when using the GNU*/Microsoft* compiler, you may
inadvertenty use inappropriate header/module files. To avoid this, copy
the header/module file(s) to a separate directory and put it in the
appropriate include path using the -I option.

I doubt FF is set up to build with OpenMP or even /Qparallel. You would get OpenMP headers by #include "omp.h"
I agree that it could be a header file problem, so that suggestion is worth a try.
If that suggestion is not specific to FF build, I would be concerned that you need C++ syntax which isn't supported by Microsoft headers (be sure to make the compiler use C++ rather than C where needed). For example, if the build is predicated on .C file being taken as C++, that won't work on Windows.

I don't think it's related to header.

It's related to /GL or /Qipo optimization. it might be compiler bug or coding issue.

Try one of the following to work around it:
1. remove /GL or /Qipo from compiler option list
2. add /qnoipo to the linker

Jennifer

Quoting alexboy94I'm trying to compile Firefox for Windows using the Intel compiler. I've managed to compile everything fine up until this point:
http://i44.tinypic.com/3010vue.png
From what I've gathered/been told,
multiple copies of the CRT are being linked.

[SergeyK] Correct.

I've tried setting the library to be used as the one given in -LIBPATH:C:\Intel\Composer XE 2011 SP1\compiler\lib\intel64

[SergeyK]It looks like two different CRT libraries with the same set of CRT-functions are used
ina linker process.

Ifan importlibrarywithmultithreaded CRT-functions ( msvcrt.lib )is used a
static link library with multithreadedCRT-functions ( libcmt.lib )must be
excluded. Or opposite.

but MINGW32 doesn't deal well with spaces and keeps returning errors.
So that didn't work. I'm not quite sure what else I can do?
If it helps I'm using the 30 day trial of Intel Composer XE 2011 SP1 Update 7.

Please take a look at MSDN's article "C Run-Time Libraries ( CRT )".

>>...
>>...I've gathered/been told, multiple copies of the CRT are being linked...
>>...

Try to check Firefox sources for #pragma commentdirectives, like

#pragma comment ( lib, "libcmt.lib" )
or
#pragma comment ( lib, "libcmtd.lib" )

Quoting TimP (Intel)
I doubt FF is set up to build with OpenMP or even /Qparallel. You would get OpenMP headers by #include "omp.h"
I agree that it could be a header file problem, so that suggestion is worth a try.
If that suggestion is not specific to FF build, I would be concerned that you need C++ syntax which isn't supported by Microsoft headers (be sure to make the compiler use C++ rather than C where needed). For example, if the build is predicated on .C file being taken as C++, that won't work on Windows.

I tried, but to no luck!

Quoting Jennifer Jiang (Intel)
I don't think it's related to header.

It's related to /GL or /Qipo optimization. it might be compiler bug or coding issue.

Try one of the following to work around it:
1. remove /GL or /Qipo from compiler option list
2. add /qnoipo to the linker

Jennifer

I tried -qnoipo as an enable optimize flag, I tried it with the linker by itself, I tried it with both and still got the same error.

Quoting Sergey Kostrov
>>...
>>...I've gathered/been told, multiple copies of the CRT are being linked...
>>...

Try to check Firefox sources for #pragma comment directives, like

#pragma comment ( lib, "libcmt.lib" )
or
#pragma comment ( lib, "libcmtd.lib" )

Any idea where I should generally look? There are thousands of files I don't know where to begin! I read the MSDN article and usually -MD sorts out this kind of error, but it doesn't this time.

>>...Any idea where I should generally look? There are thousands of files I don't know where to begin!

You have to look at all files with extensions: '.h', '.hxx', '.cxx', '.c', '.cpp', '.inl' or just everything '*.*'

>>I read the MSDN article and usually -MD sorts out this kind of error, but it doesn't this time...

If two differentlibraries ( static and import )are used for the same set of CRT-functionsit can't resolve
it.

Where did you download Firefox sources from?

You could also trythe /FORCE or /FORCE:MULTIPLE linker options because they willoverride the
LNK1169error.

Note: I used it once some time ago and I remember that it resolved some linking problems on a project.

Take a look at MSDN's topic "Linker Tools Error LNK1169"

Quoting Sergey Kostrov
>>...Any idea where I should generally look? There are thousands of files I don't know where to begin!

You have to look at all files with extensions: '.h', '.hxx', '.cxx', '.c', '.cpp', '.inl' or just everything '*.*'

>>I read the MSDN article and usually -MD sorts out this kind of error, but it doesn't this time...

If two differentlibraries ( static and import )are used for the same set of CRT-functionsit can't resolve
it.

Where did you download Firefox sources from?

But there are over 30,000 files which at least half are C/C++ related files. I have to check each and everyone one of them for libcmt.lib?

I downloaded the source straight from Mozilla.

Quoting Sergey Kostrov
You could also try the /FORCE or /FORCE:MULTIPLE linker options because they will override the
LNK1169 error.

Note: I used it once some time ago and I remember that it resolved some linking problems on a project.

Take a look at MSDN's topic "Linker Tools Error LNK1169"

I tried that, when I do that it gives me the other error:

http://i42.tinypic.com/15q9imc.png

LNK1120 error with 292 unresolved externals.

I can't possibly need to edit that many files. I found someone who has made successful firefox builds with ICC here:

http://hi.baidu.com/coolypf/blog/item/9abb1cd69d84cec8a044df25.html

Translated:

http://translate.googleusercontent.com/translate_c?hl=en&ie=UTF8&prev=_t...

But I've done the same modifications he has up to part 3, after part 3 is irrelevant because that's how to get PGO to work.

is the config containing the "-fast" option?
it contains "-ipo". soremove "-fast", use"-xSSE3 -O2" or "-arch:SSE3 -O2" instead.

Jennifer

Quoting Jennifer Jiang (Intel)
is the config containing the "-fast" option?
it contains "-ipo". soremove "-fast", use"-xSSE3 -O2" or "-arch:SSE3 -O2" instead.

Jennifer

I changed it to -O3 -Qprec-div -QxO, like you said. Still gives the error.

EDIT: Great news, I fixed it! Turns out I had too many commands that were conflicting. This is a build without any optimization flags though, so hopefully when I put some I don't get the same errors again! Thank you everyone for your help, it is greatly appreciated.

Quoting Jennifer Jiang (Intel)Use the short-name for "Composer XE 2011 SP1" instead.

To find the short name for it, open a cmd prompt, use cmd "dir /X". It will list the short-name for it similar to "COMPOS~2"

Jennifer

I've done some verifications related to different source file & foldernames, like "..\Common Tests" or
"..\Main Test.cpp" ( with one space ), and MinGW v3.4.2handled it properly.

I've got bad news. The build didn't work :(. I got down to the VERY last part of the compilation process where fake.lib and fake.exp and got another LNK error. Strangely enough, when I compile with pymake I don't get that far in the compilation process and instead get an error with the ANGLE files:

I can't exactly make out what the error is. Any ideas how I could go about fixing it?

Evidently, your command line options are mixed up by the time you reach this point. The force and nodefaultlib options, if you really want them, must come after /link so that they pass on to the Microsoft tools. If you are looking for help with pymake, you're more likely to find it on a forum dealing with your variety of python. You've got a bewildering combination of forward and backslash conventions.

Hello,

what I can see is that it fails because of the following command:

expand "" -F:d3dx9_43.dll "../../dist/bin"

I assume the build wanted to extract a file (d3dx9_43.dll) from a CAB archive. However the CAB archive is not specified (empty double quotes): ""

Could you take a look at the corresponding Makefile (C:\Users\Administrator\Downloads\objdir\gfx\angle\Makefile), line 143, and see what should have been enclosed in double quotes. Maybe some variable is not specified.
Under the line it looks to me like an external dependency that's not satisfied. Maybe you need to download some CAB archive and store it at a fixed location before kicking-off the build.

Best regards,

Georg Zitzlsberger

Do you haveDirectX 9 or 10 on your computer?

The d3dx9_43.dll has to be inside of some cab-file in a '\Redist'folder.

PS: Try to search the web because "d3dx9_43.dll is missing" is a popular subject.

Quoting TimP (Intel)
Evidently, your command line options are mixed up by the time you reach this point. The force and nodefaultlib options, if you really want them, must come after /link so that they pass on to the Microsoft tools. If you are looking for help with pymake, you're more likely to find it on a forum dealing with your variety of python. You've got a bewildering combination of forward and backslash conventions.

It occurs without -FORCE and -NODEFAULTLIB.

Hi Alexboy, could you tell me thefirefox version you are working on? I am trying to recompile it here so that I can do some with you.

Thanks,
Wise

Quoting Georg Zitzlsberger (Intel)
Hello,

what I can see is that it fails because of the following command:

expand "" -F:d3dx9_43.dll "../../dist/bin"

I assume the build wanted to extract a file (d3dx9_43.dll) from a CAB archive. However the CAB archive is not specified (empty double quotes): ""

Could you take a look at the corresponding Makefile (C:\Users\Administrator\Downloads\objdir\gfx\angle\Makefile), line 143, and see what should have been enclosed in double quotes. Maybe some variable is not specified.
Under the line it looks to me like an external dependency that's not satisfied. Maybe you need to download some CAB archive and store it at a fixed location before kicking-off the build.

Best regards,

Georg Zitzlsberger

Quoting Sergey Kostrov
Do you have DirectX 9 or 10 on your computer?

The d3dx9_43.dll has to be inside of some cab-file in a '\Redist' folder.

PS: Try to search the web because "d3dx9_43.dll is missing" is a popular subject.

Quoting Sergey Kostrov
Here are two web-links for your review:

http://www.ihaveapc.com/2010/11/how-to-fix-d3dx9_43-dll-missing-error-in-windows-7/

http://pcsupport.about.com/od/findbyerrormessage/a/d3dx9_43-dll-not-found-missing-error.htm

I have the DirectX SDK and d3dx9_43.dll installed where they should be. The build runs fine with MSVC. I tried to use -disable-angle but still get the same error.

Quoting Wise Chen (Intel)
Hi Alexboy, could you tell me thefirefox version you are working on? I am trying to recompile it here so that I can do some with you.

Thanks,
Wise

I'm trying to build Firefox 10 Beta 4. I tried Beta 3 and Firefox 9 Beta 6, but for some reason I get the same errors on all of them.

Hello,

I've checked the Makefile from Firefox.
It needs $MOZ_D3DX9_CAB to be set. In your case it is not. This variable will be defined in the configure script via:

MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`

Looks like it cannot find the d3dx9_... CAB archive. This can be due to different versions or paths are not correct. Please print out this line when running configure and check what's wrong (why find tool cannot find the CAB archive file).

Alternative: Turn off WebGL (gfx/angle) component if you don't need it.

Best regards,

Georg Zitzlsberger

Quoting Georg Zitzlsberger (Intel)
Hello,

I've checked the Makefile from Firefox.
It needs $MOZ_D3DX9_CAB to be set. In your case it is not. This variable will be defined in the configure script via:

MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`

Looks like it cannot find the d3dx9_... CAB archive. This can be due to different versions or paths are not correct. Please print out this line when running configure and check what's wrong (why find tool cannot find the CAB archive file).

Alternative: Turn off WebGL (gfx/angle) component if you don't need it.

Best regards,

Georg Zitzlsberger

My mistake, I forgot to install the redistributables, but now I get the 1169 error, right before the end of compiling the whole program:

Thanks Alexboy, I am trying to download the package and build it here. Will be back for you.

Quoting Wise Chen (Intel)
Thanks Alexboy, I am trying to download the package and build it here. Will be back for you.

Hope it goes well. Thanks!

>>...
>>...failed, return code 1169
>>...

It looks like LNK1169, but without LNK prefix! I think it was returned from Python2.7.exe.

If you look a couple of lines above there is a realLNK1169 error. Then, above that there is LNK4098, and
above that there is LNK2005.

Have you seen these LNK errors?

Best regards,
Sergey

Quoting Sergey Kostrov
>>...
>>...failed, return code 1169
>>...

It looks like LNK1169, but without LNK prefix! I think it was returned from Python2.7.exe.

If you look a couple of lines above there is a realLNK1169 error. Then, above that there is LNK4098, and
above that there is LNK2005.

Have you seen these LNK errors?

Best regards,
Sergey

I've seen the errors, still get them unfortunately.

Let's go over these linker errors:

- LNK1169 - One or more multiply defined symbols found
- LNK4098 - Defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
- LNK2005 - Symbol already defined in object

You could get more technical details for these errors fromMSDN.

My recommendations are as follows:

- Create a master list of ALLlibraries ( *.lib ) referenced in Make files, etc.

-Search all sources for #pragma comment ( lib, ... ) directives. If something is found update the
master list of ALL libraries.

- Don't try to resolve ALL problems at the same time. In your caselinker errorshave to be solved in the
following order ( based on a recent screenshot ):

LNK2005
LNK4098
LNK1169

- Redirect a Build output to a txt-file, then print it, and carefully go through every line.Make sure that
during that process nobody interrupts you.

- Uploading screenshots is a good way to show some problems but I would prefer to see a complete Build
output redirected to a txt-file.

- Uploading Make files would also help ( don't miss anything ).

- Try to understand what is going on with 'Expand.exe' command line utility. Did you try to execute it
from a folder where you start your Build process?

- Try to simulate some linker errors in a small project in order to understand completely howthey could be
fixed or resolved.

- Did you try to contact Firefox software developers?

Best regards,
Sergey

Quoting Sergey Kostrov
Let's go over these linker errors:

- LNK1169 - One or more multiply defined symbols found
- LNK4098 - Defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
- LNK2005 - Symbol already defined in object

You could get more technical details for these errors fromMSDN.

My recommendations are as follows:

- Create a master list of ALLlibraries ( *.lib ) referenced in Make files, etc.

-Search all sources for #pragma comment ( lib, ... ) directives. If something is found update the
master list of ALL libraries.

- Don't try to resolve ALL problems at the same time. In your caselinker errorshave to be solved in the
following order ( based on a recent screenshot ):

LNK2005
LNK4098
LNK1169

- Redirect a Build output to a txt-file, then print it, and carefully go through every line.Make sure that
during that process nobody interrupts you.

- Uploading screenshots is a good way to show some problems but I would prefer to see a complete Build
output redirected to a txt-file.

- Uploading Make files would also help ( don't miss anything ).

- Try to understand what is going on with 'Expand.exe' command line utility. Did you try to execute it
from a folder where you start your Build process?

- Try to simulate some linker errors in a small project in order to understand completely howthey could be
fixed or resolved.

- Did you try to contact Firefox software developers?

Best regards,
Sergey

Well the makefiles don't say which libs specifically are called. But this error is caused by libraries being linked in the wrong order, which is weird because the msvc compiler doesn't have a problem but icc does. So following this page:

http://msdn.microsoft.com/en-us/library/6wtdswk0%28v=vs.100%29.aspx

-NODEFAULTLIB:libc.lib -NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcd.lib -NODEFAULTLIB:libcmtd.lib -NODEFAULTLIB:msvcrtd.lib

Which SHOULD sort the error out but doesn't.

If I try sorting out LNK2005 like it says here:

http://msdn.microsoft.com/en-us/library/72zdcz6f%28v=vs.100%29.aspx

Nothing changes

and if I try LNK4098/1169 using NODEFAULTLIB it still produces the EXACT same error. *Sigh*.

I haven't tried /INCREMENTAL but I'm not sure what options I should be using for it.

http://msdn.microsoft.com/en-us/library/4khtbfyf%28v=vs.100%29.aspx

Quoting alexboy94...
I haven't tried
/INCREMENTAL but I'm not sure what options I should be using for it.
...

I wouldn't try to change it.

Do you have any response from a Firefox community?

Best regards,
Sergey

Quoting Sergey Kostrov
Quoting alexboy94...
I haven't tried
/INCREMENTAL but I'm not sure what options I should be using for it.
...

I wouldn't try to change it.

Do you have any response from a Firefox community?

Best regards,
Sergey

Oh yes sorry I forgot to post the link to that

http://groups.google.com/group/mozilla.dev.builds/browse_thread/thread/b6b4ec0bdc9534a3#

The main points:

As I already noted, these errors are caused by you linking multiple
copies of the C runtime. You are linking both the dynamic version
(msvcrt) and the static version (libcmt). You need to figure out why
both copies of the CRT are being pulled into your project.

Which would be solved easily with -NODEFAULTLIB except:

It appears that the Intel linker you're using doesn't support a MSVC
feature in use (the -NODEFAULTLIB flag);

For some reason, -link isn't accepted as a valid flag but -Xlinker is, but it's still an 'unknown' option.

I've just checked an image from Post #19 andthis is what I found:

...
icl: command line warning #10006: ignoring unknown option '/NODEFAULTLIB:LIBCMT'
...

What to do now? Could somebody from Intel give an advice?

Best regards,
Sergey

Quoting Sergey Kostrov
I've just checked an image from Post #19 andthis is what I found:

...
icl: command line warning #10006: ignoring unknown option '/NODEFAULTLIB:LIBCMT'
...

What to do now? Could somebody from Intel give an advice?

Best regards,
Sergey

That's what I'm wondering as well. Really it should be done like this:

'-link -nodefaultlib:libcmt'

But for some reason -link is an invalid flag and when using the linux version of that flag (Xlinker) it just says ignoring unknown option.

Hi Alexboy,
How do you setup icl environment in mozilla-build environment? I tried to run compilervar.bat is32 vs2008 under $ of mozilla-build command line, but failed.

Hi Alexboy,

In these days, I searched google and found there is article to introduce how to build firefox with icc in this URL http://code.google.com/p/pcxfirefox/. But when I tried to build it with icc after patch, I got below error message:
...
checking for windres... no
checking for midl... midl
configure: error: The linker major version, , does not match the compiler suiteversion, 11.
*** Fix above errors and then restart with "make -f client.mk build"
make[2]: *** [configure] Error 1
make[2]: Leaving directory `/c/mozilla-central'
make[1]: *** [obj-i686-pc-mingw32/Makefile] Error 2
make[1]: Leaving directory `/c/mozilla-central'
make: *** [build] Error 2

Do you have this kind of experience?

Thanks,
Wise

Following URL guide information, I can config icl make&configure. And I met the same issue with Alex duing build firefox with icl.

Hi Wise,

Could you provide a brief summary of ALL your errors? Are you going to work on the problem for some time?

Best regards,
Sergey

It's strange.

pcxfirefox is my one project, and I use my wiki guide to build firefox 10 successfully.

--------------------------------------------------------------------------------------------------------------
You can try

https://pcxfirefox.googlecode.com/files/Firefox-10.0-en-pcx-win32-120202...

https://pcxfirefox.googlecode.com/files/Firefox-10.0-en-pcx-win64-120204...
--------------------------------------------------------------------------------------------------------------

Maybe our icl edition is different, can you provide your modification (mozconfig/patches/start-icc.bat)?

Best Regards,
xunxun

Quoting xunxunIt's strange.

pcxfirefox is my one project, and I use my wiki guide to build firefox 10 successfully.
...

Thanks for the response and as you can see this is a long story.

What ICL version do you use?

It seems it's 12.1.2.278 in my wiki, I think it's icc12 update8.

I have built the edition some days ago, so I forgot it ...

Best Regards,
xunxun

Alex had a couple of Linker errors, like:

- LNK1169 - One or more multiply defined symbols found
- LNK4098 - Defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
- LNK2005 - Symbol already defined in object

Note: Take a lookat aPost #33.

What do you think?

Did you make any changes in make files,in environment variables, etc?

Best regards,
Sergey

Quoting Sergey Kostrov
Alex had a couple of Linker errors, like:

- LNK1169 - One or more multiply defined symbols found
- LNK4098 - Defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
- LNK2005 - Symbol already defined in object

Note: Take a lookat aPost #33.

What do you think?

Did you make any changes in make files,in environment variables, etc?

Best regards,
Sergey

No, I have not encounted it.

I only modify like https://code.google.com/p/pcxfirefox/wiki/MozillaBuiltICC#Step_1_Patch_s... and https://code.google.com/p/pcxfirefox/wiki/MozillaBuiltICC#Step_2_Patch_M...

I have no idea how the issues came out.

If you give me all output information, maybe I will find it out.

Best Regards,
xunxun

Quoting xunxun...If you give me all output information, maybe I will find it out.

Sorry, I wassimply helping 'Alexboy94' to resolve some linking issues and the same applies to many other
users responded to his initialpost. I hope hewill respond ifinterested.

Best regards,
Sergey

Leave a Comment

Please sign in to add a comment. Not a member? Join today