how to compile using Visual Studio?

Bob Price rjp_email at
Wed Oct 31 07:19:43 PDT 2012

I have been trying unsuccessfully to compile jemalloc with Visual Studio 10.0 and 11.0 with no luck.

The files and website mention mingw and windows separately, and the msvc_compat headers seem targeted for this, so I assume that it is possible.

What I want to do is setup jemalloc with a unique prefix on the public methods and compile it to a static library to be able to use it as the memory allocator for just one part of a larger 64-bit application.

Can anyone give me some guidance here?

What I have tried so far is as follows, using the current 3.1.0 download:

Since I couldn't find a way to do this on Windows, I used a 64-bit Linux box and ran ./configure --with-jemalloc-prefix=je_ --with-private-namespace=jeint_ to (hopefully) get all the header files in the desired state.  Then I copied everything over to a 64-bit Windows7 with the MS SDK and Visual Studio installed, and I borrowed a makefile I use on another C library and updated the options to include the jemalloc include and include/msvc_compat directories, and to ensure that _WIN32 is defined, and set it up to compile all C code in src. 

When I run this and it tries to compile arena.c I get all kinds of redefinition errors and warnings from msvc_compat\stdint.h and then many syntax errors in include\jemalloc\internal\jemalloc.h.

I suspect that the issue results from the configure on a Linux system, but instead of spending hours trying to understand how to manually do this for Windows VS I hope that someone here can get me going much more quickly.

Thanks for any help you can provide!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the jemalloc-discuss mailing list