Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Alex_K_6
Beginner
876 Views

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.
0 Kudos
46 Replies
JenniferJ
Moderator
631 Views

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
Alex_K_6
Beginner
631 Views

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.
JenniferJ
Moderator
631 Views

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

Jennifer
Alex_K_6
Beginner
631 Views

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.
JenniferJ
Moderator
631 Views

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
Alex_K_6
Beginner
631 Views

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-us/cpp/win/optaps/common/op...

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.

TimP
Black Belt
631 Views

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.
JenniferJ
Moderator
631 Views

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
SergeyKostrov
Valued Contributor II
631 Views

Quoting alexboy94
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.

[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 )".

SergeyKostrov
Valued Contributor II
631 Views

>>...
>>...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" )
Alex_K_6
Beginner
631 Views

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!

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.

>>...
>>...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.

SergeyKostrov
Valued Contributor II
631 Views

>>...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?
SergeyKostrov
Valued Contributor II
631 Views

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"
Alex_K_6
Beginner
631 Views

>>...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.

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&rurl=translate.google.com&s...

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.

JenniferJ
Moderator
631 Views

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

Jennifer
Alex_K_6
Beginner
631 Views

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.

SergeyKostrov
Valued Contributor II
631 Views

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.

Alex_K_6
Beginner
631 Views

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?
TimP
Black Belt
631 Views

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.
Georg_Z_Intel
Employee
311 Views

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
Reply