views:

254

answers:

4

I made a small program with Boost in Linux 2 yrs ago. Now I want to make it work in Windows. I found there are few .a files in my libs folder. I am wondering how to make it works in Windows? do I need to build Boost in Windows to get library or I can download somewhere? I am using Visual Studio 6.

+6  A: 

Yes, you'll need to recompile for different platforms. Coincidentally, I posted instructions on this not long ago.

I hugely recommend you do not use Visual Studio 6. It's very dated, and terribly non-conforming. You can get the newer versions for free, as Express. You won't be missing anything.

GMan
second the motion for getting an updated compiler.
wheaties
OK, I can use VS 2003, then how to set the build parameter?
5YrsLaterDBA
I've updated the linked answer. Use 7.1 to refer to 2003.
GMan
should I uninstall my old VS6.0 and install the 2003? or just install it without uninstall my old 6.0?
5YrsLaterDBA
@5YrsLater: They can live together. :)
GMan
+2  A: 

Many boost libraries are header-only, you don't need to link against anything to use them. Libraries such as boost::filesystem require you to build libs appropriate for your platform and link against them.

Precompiled boost for MSVC7,8,9 can be found here (in the hope that you follow GMan's advice and get rid of VS6 …)

Alexander Gessler
A: 

.a files from Unix are like .lib files in Windows. They will not work, and there is no way of "converting" them, short of using a compiler on the original source code.

However, Boost does build on Windows. Just download it (or more likely, the closest version you can find to the one your code was using).

Older versions of Boost did work under VS6, but with a whole lot of stuff disabled (VS6 really just barely qualified as a C++ compiler). If you can, I highly suggest you use a newer version of Visual Studio.

T.E.D.
A: 

You have a few options. Building Boost will give you the greatest flexibility in working with your application and boost libraries. However, you can download pre-built Boost libraries wrapped up in a nice windows installer here, Boost Packages

But one thing to keep in mind, depending on what you used in Boost, a lot of it is template based so no libraries are required. If you're only using some templatized portions, you don't need to worry about any of this. Just make sure you have boost in your include path when building.

As a side note, you can get free but limited versions of newer MS compilers here: http ://www.microsoft.com/exPress/

Shayan