Alembic compile fails on boost libs linking on Windows



I’m trying to compile Alembic library but I’ve failed on linking even the most basic file: boost_trycompile.cpp

I’ve taken it out of the alembics build/trycompile directory and generated a solution files with CMAKE.
I’ve also built the boost libraries using multithreaded and static flags.

Now here is an error I get from Visual Studio 2010

  1>------ Build started: Project: ZERO_CHECK, Configuration: RelWithDebInfo x64 ------
  2>------ Build started: Project: boostTest, Configuration: RelWithDebInfo x64 ------
  2>  Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
  2>  Copyright (C) Microsoft Corporation.  All rights reserved.
  2>  cl /c /Zi /W3 /WX- /O2 /Ob1 /D _WIN64 /D NDEBUG /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D _MBCS /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"boostTest.dir\RelWithDebInfo\\" /Fd"boostTest.dir\RelWithDebInfo\vcWindows7.1SDK.pdb" /Gd /TP /errorReport:prompt ..\boost_trycompile.cpp
  2>  boost_trycompile.cpp
  2>D:\alembic\out\boost\include\boost-1_42\boost/thread/future.hpp(411): warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
  2>boost_trycompile.obj : error LNK2019: unresolved external symbol "private: void __cdecl boost::thread::start_thread(void)" (?start_thread@thread@boost@@AEAAXXZ) referenced in function "public: __cdecl boost::thread::thread<void (__cdecl*)(void)>(void (__cdecl*)(void),struct boost::thread::dummy *)" (??$?0P6AXXZ@thread@boost@@QEAA@P6AXXZPEAUdummy@01@@Z)
  2>boost_trycompile.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::thread::~thread(void)" (??1thread@boost@@QEAA@XZ) referenced in function main
  2>boost_trycompile.obj : error LNK2019: unresolved external symbol "public: void __cdecl boost::thread::join(void)" (?join@thread@boost@@QEAAXXZ) referenced in function main
  2>D:\alembic\boost_trycompile\build\RelWithDebInfo\boostTest.exe : fatal error LNK1120: 3 unresolved externals
  3>------ Skipped Build: Project: ALL_BUILD, Configuration: RelWithDebInfo x64 ------
  3>Project not selected to build for this solution configuration 
  ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

The linker cannot compile .lib files of boost even if it can locate it.
I’ve ran out of ideas how to fix it, uncle google also could not give me a straight answer.
Help :frowning:


Welcome to symbols hell, a place where most people dealing with Boost, DLLs or Alembic often end up, and where anybody dealing with any two or three at the same time is guaranteed to spend a long time.

You will have to explicitly export the symbols/tabling. I don’t do enough dev work in windows to know how you facilitate that for DLLs (short of doing it manually across the board, which would be a major pain in the arse), but if it’s any help I don’t think you’re doing anything inherently wrong, you’re just dealing with something that, frankly speaking, is a bitch of an issue. A rather common one too.

You’ll have to grunt through this one if you’re OK embedding hacks source side, or spend more time automating the process if you plan to do it repeatedly as versions increment and you don’t want to manage mergings.


Ok - my problem was the compiler. I’ve been using the visual studio 2010 express and trying to compile boost 64bit. When I’ve switched to full VS2010 professional the problem dissapeared. However I’m still hitting some walls with that.


There is no difference in compiler between express and professional, the only difference pre VS2012 was that the express edition was limited to the 32bit compiler bundle wise, but you could always access (for free) and configure the 64bit one that came with the win SDK 7.1.
It’s also possible you might need some compiler flags/options, in my (limited) experience with VC has usually been like that several times. It probably is lack of knowledge, but personally I find it horribly convoluted and overcomplicated, and the errors utterly meaningless, compared to your average modern Linux counterparts.

Do you have a valid vcproj or cmake with those things that might give hints to some define that might be required? It’s perfectly possible the linker is crapping itself because without certain defs there will be missing exports and such (e.g. the classing NT_PLUGIN and REQUIRE_IOSTREAM for maya plugins).


Hello and thanks for the hints.

Right now I’ve managed to go through cmake and I have a Visual Studio solution.
However while trying to compile the alembicmodule project I get this error:

2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(63): warning C4003: not enough actual parameters for macro 'min'
2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(64): warning C4003: not enough actual parameters for macro 'max'
2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(63): error C2059: syntax error : '('
2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(63): error C2059: syntax error : ')'
2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(63): error C2143: syntax error : missing ')' before '?'
2>D:\alembic\dep\ilmbase\include\OpenEXR\halfLimits.h(63): error C2143: syntax error : missing ';' before '?'

Do I need to add some flags or include something?
I’m stuck :confused:


Is there an online repo you can link directly to that file to have a look at it?
It might be some compiler directives or macros that don’t translate to VS 1:1 and might need tweaking.
You might also need some flags in the CMake to be transmitted to the project, things like iostream etc. but wthout being familiar with the project itself, and only mildly familiar with VCProj it’s hard for me to take a guess at such a distance from the problem.



It took me about three months of trials (not every day ofcourse - only some after work research).
You may ask “Why to do such a thing - Alembic is pre-compiled and shipped with Maya by default”.
Well thanks to this I’ve learned cmake, that allowed me to create a base for a build system in my company (now we build every plugin with a cmake and I’ve learned a lot about windows compiling, the library linking etc.)

There is one major thing that should be taken under consideration while building those plugins:
Before you can succesfully link to the hdf5 library you have to edit the H5.c file and remove the whole dllMain function. If it is compiled into the H5.obj (and furthermore into hdf5.lib) it will not allow to link the hdf5.lib, because such symbol is being linked into the abcexport.obj during compilation. This causes this error:
hdf5.lib(H5.obj) : error LNK2005: DllMain already defined in AbcExport.obj

Now it’s time for something more difficult; the cortex-vfx library under windwos:)



Hi, Michael

It’s been a long time, since last reply…

but I am currently trying to build Alembic 1.6 on windows

for maya 2016 and keep hitting walls…

I am very new for this hard work,

so… hope if you have some time to share some basic concept,

like building environment, do I have to use gnuwin or mingw?

Please please share some hint or tips if you could, thank you so much!


sorry, double post