CGTalk > Technical > Graphics Programming
Login register
reply share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-31-2014, 12:00 PM   #1
kroopson
Veteran
portfolio
Michael Krupa
Pipeline TD
Platige Image
Warsaw, Poland
 
Join Date: Jan 2003
Posts: 57
Alembic compile fails on boost libs linking on Windows

Hi.

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

Code:
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> 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> 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\b oostTest.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 :(
 
Old 08-05-2014, 11:06 PM   #2
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
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.
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 08-11-2014, 02:16 PM   #3
kroopson
Veteran
portfolio
Michael Krupa
Pipeline TD
Platige Image
Warsaw, Poland
 
Join Date: Jan 2003
Posts: 57
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.
 
Old 08-13-2014, 04:56 AM   #4
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
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).
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 09-08-2014, 11:33 AM   #5
kroopson
Veteran
portfolio
Michael Krupa
Pipeline TD
Platige Image
Warsaw, Poland
 
Join Date: Jan 2003
Posts: 57
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:

Code:
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 :/
 
Old 09-08-2014, 11:59 AM   #6
ThE_JacO
MOBerator-X
 
ThE_JacO's Avatar
CGSociety Member
portfolio
Raffaele Fragapane
That Creature Dude
Animal Logic
Sydney, Australia
 
Join Date: Jul 2002
Posts: 10,954
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.
__________________
"As an online CG discussion grows longer, the probability of the topic being shifted to subsidies approaches 1"

Free Maya Nodes
 
Old 11-13-2014, 09:34 AM   #7
kroopson
Veteran
portfolio
Michael Krupa
Pipeline TD
Platige Image
Warsaw, Poland
 
Join Date: Jan 2003
Posts: 57
HOLY MOTHER OF A FATHER!!! I DID IT!

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

Cheers..
 
Old 08-26-2016, 09:31 AM   #8
davidpower
Explorer
portfolio
David Lai
Taipei, Taiwan
 
Join Date: Aug 2011
Posts: 3
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!
 
Old 08-26-2016, 09:38 AM   #9
davidpower
Explorer
portfolio
David Lai
Taipei, Taiwan
 
Join Date: Aug 2011
Posts: 3
sorry, double post

Last edited by davidpower : 08-27-2016 at 07:54 PM. Reason: Double post
 
reply share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:19 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.