views:

100

answers:

3

I have a C++ static library that supports both x32 and x64 platforms.

My question is: should I name the .lib file different depending on which platform?

i.e. MyLib32.lib vs MyLib64.lib

Intel Math library and TBB handle this using folder name to differentiate between the 2 libraries instead.

i.e. x32\Math.lib vs x64\Math.lib

Is there a better way compared to the other?

I think explicitly naming the lib to correspond to the intended platform should be better? That way we dont depend on folder name and the lib is self-documenting.

A: 

No, I don't think that one approach is superior to the other, and I think you've properly enumerated the two differences in each.

From my experience, however, many libraries have the same name, but are kept in either separate folders and are distributed in separate zip files.

LPSolve on sourceforge, for example, has their binaries named the same, regardless of platform.

Alan
+4  A: 

Be nice to your users and add 32 or 64 to the end like you propose. It's absolutely 100% clear what it means at first glance and you'll never mix them up.

Nick Veys
+1 as I prefer this convention as well. Specially is you are talking about different arch. eg: mylib_x32, mylib_x64, mylib_arm, mylib_ppc
Wayne
+1  A: 

I've been doing a lot of 32 and 64 bit work lately and I definitely prefer different names.

jcopenha