Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
 
Thread Tools  Search this thread 
Igor Levicki
Total Points: 6830
Status Points: 6830
Black Belt
May 22, 2008 7:42 AM PDT
/Zl switch does not work

I compile a project with /Zl switch added to the command line and in the resulting obj/lib files I still get strings:

-defaultlib:"uuid.lib" -defaultlib:"uuid.lib" -defaultlib:"libirc"

That's right, uuid.lib is listed twice for each object file as if once wouldn't be enough.

Why is the /Zl switch interpreted half-way only? When I say "ignore default libraries" I mean all of them!

Jennifer Jiang (Intel)
Total Points: 5850
Status Points: 5350
Brown Belt
May 28, 2008 2:23 PM PDT
Rate
 
#1
VC2005 cl.exe has the same behavior. You can use /nodefaultlib at link that will ignore all the default libs include uuid.lib/libirc.
Igor Levicki
Total Points: 6830
Status Points: 6830
Black Belt
May 28, 2008 4:42 PM PDT
Rate
 
#2 Reply to #1

Jennifer, I am sorry but MSVC 2005 cl.exe doing the same is a poor excuse unless you meant to say that it is a compatibility hack.

I am still curious why does the compiler emit uuid.lib twice? Isn't once enough?

I have seen duplicate library names emitted into object files several times with ICC, sometimes just one name, sometimes all library names are repeated. Fixing it (if it is an error on compiler side) could perhaps improve compile and link speed a bit for those extra large projects with thousands of files.

Jennifer Jiang (Intel)
Total Points: 5850
Status Points: 5350
Brown Belt
May 28, 2008 6:14 PM PDT
Rate
 
#3 Reply to #2

ICL has to match CL on this in order to do mix-match linking.

After talking with experts on this, the uuid.lib is not inserted by the compiler. It's likely in the VC header files twice like "#pragma comment(lib:uuid.lib)". so it's in .obj twice.  As my testcase, it has "#include <windows.h>". It brings the uuid.lib twices in the .obj file.

Igor Levicki
Total Points: 6830
Status Points: 6830
Black Belt
May 28, 2008 9:36 PM PDT
Rate
 
#4 Reply to #3

Ok, we are getting somewhere.

Could you please ask the experts why the compiler does not coalesce multiple pragmas which reference the same library file?

I have tested it and Microsoft compiler does the same but I want to know why. Is it a bug which somehow got "copied" to Intel compiler or is it really neccessary to have duplicate references in order for the linker to work?

Igor Levicki
Total Points: 6830
Status Points: 6830
Black Belt
June 12, 2008 11:17 AM PDT
Rate
 
#5 Reply to #4

Any update on this?

Brandon Hewitt (Intel)
Total Points: 340
Status Points: 290
Green Belt
June 20, 2008 11:00 AM PDT
Rate
 
#6 Reply to #5

Hi Igor,

It's not necessary to have the duplicates, and certainly our front end could implement a logic to coalesce these #pragma comment statements, but is there any problem with having the multiple -defaultlib references?

Igor Levicki
Total Points: 6830
Status Points: 6830
Black Belt
June 20, 2008 4:46 PM PDT
Rate
 
#7 Reply to #6

Not a real problem as such but:

  • It looks sloppy for a product labeled as "Professional"
  • It is unneccessary waste of disk space
  • Coalescing may improve build times for large projects

I would certainly like to see it fixed even though it is a minor issue.

Brandon Hewitt (Intel)
Total Points: 340
Status Points: 290
Green Belt
June 20, 2008 5:57 PM PDT
Rate
 
#8 Reply to #7
I would submit a Premier Support issue then, but I would not expect this to be addressed quickly.  It's hard to find a case where the disk space issue would be compelling enough to be a concern, and I would suspect that the fix itself might actually hinder build times if anything, due to the fact that the front end would now have to keep track of which #pragma comment libs were processed, and then do a compare each time it processes a new #pragma comment.  Again, though, that wouldn't be significant in most if not all cases.  I agree that it does look sloppy.

Forum Statistics

4466 users have contributed to 23967 threads and 69726 posts to date.
In the past 24 hours, we have 18 new thread(s) 44 new posts(s), and 67 new user(s).

In the past 3 days, the most popular thread for everyone has been Catastrophic error The post with the most views is Rfid reader JAVA applicattion The most posts were made to

Please welcome our newest member paulfoel