Many thanks Aidan, Your suggestion of using the emscripten llvm-nm helped a lot, and I could solve the link problems with opencv. Concerning boost, I still have issues with the link. May be I am doing it the wrong way.
Here is what I tried concerning the symbol _ZN5boost6system16generic_categoryEv : i) Check which lib uses it and which defines it : The command : for f in boost-emscripten-1.59/lib/libboost_*.a; do echo $f; em-llvm-nm $f | grep _ZN5boost6system16generic_categoryEv; done ==> shows me that it is defined inside libboost_system.a : boost-emscripten-1.59/lib/libboost_system.a 0000000000000000 T __ZN5boost6system16generic_categoryEv ii) Add again this library at the end of the link command ==> this does not solve the issue iii) Add "-Wl,--undefined=__ZN5boost6system16generic_categoryEv" to the beginning of the link COMMAND ==> this does not help either I will try other possibilities. Do you have any other hint as to what I might have forgotten ? Regards, Pascal Thomet On Saturday, September 5, 2015 at 4:01:22 PM UTC+2, Aidan Hobson Sayers wrote: > > You've run nm against the .a file, not the .so (which is what you link). > What happens if you try the typical approach of adding that file again to > the end of your link command line? > > Additionally, are you using the system nm rather than llvm-nm (from the > emscripten llvm build)? > > On 5 September 2015 at 14:45, Pascal Thomet <pth...@ivsweb.com > <javascript:>> wrote: > >> >> Hello Alon, >> >> Thanks again for your last answer. >> >> I have recompiled all the third party libraries in my project (they were >> compiled by an older version of emscripten) >> >> This solved partially the problem : >> 1) The linker does not ouput anymore errors like >> "unexpected number of arguments 2 in call to >> '_ZNKSt3__18ios_base6getlocEv'" >> ==> this is good. I understand that it is advisable to compile all >> the libraries and code with the same compiler version. >> >> 2) However I still have some link issues, and my study of these errors >> makes me think there is a problem during the link >> in the latest versions of emscripten. See the results of my analysis >> below. >> >> i) When I link, I get the following errors : >> >> warning: unresolved symbol: >> _ZN2cv9patchNaNsERKNS_17_InputOutputArrayEd >> warning: unresolved symbol: _ZN2cv3hal8CholeskyEPfjiS1_ji >> warning: unresolved symbol: _ZN5boost9re_detail13get_mem_blockEv >> warning: unresolved symbol: >> _ZN5boost9re_detail14verify_optionsEjNS_15regex_constants12_match_flagsE >> warning: unresolved symbol: _ZN2cv3hal2LUEPfjiS1_ji >> warning: unresolved symbol: cvCbrt >> warning: unresolved symbol: _ZN2cv3hal8CholeskyEPdjiS1_ji >> warning: unresolved symbol: >> _ZN5boost9re_detail19raise_runtime_errorERKSt13runtime_error >> warning: unresolved symbol: >> _ZNK5boost9re_detail31cpp_regex_traits_implementationIcE9transformEPKcS4_ >> warning: unresolved symbol: _ZN5boost9re_detail13put_mem_blockEPv >> warning: unresolved symbol: >> _ZN5boost9re_detail24get_default_error_stringENS_15regex_constants10error_typeE >> warning: unresolved symbol: >> _ZNK5boost9re_detail31cpp_regex_traits_implementationIcE17transform_primaryEPKcS4_ >> warning: unresolved symbol: >> _ZN2cv9RodriguesERKNS_11_InputArrayERKNS_12_OutputArrayES5_ >> warning: unresolved symbol: _ZN5boost6system15system_categoryEv >> warning: unresolved symbol: >> _ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j >> warning: unresolved symbol: _ZN2cv3hal2LUEPdjiS1_ji >> warning: unresolved symbol: _ZN5boost6system16generic_categoryEv >> >> ii) Analysis of boost related link errors: >> For example _ZN5boost6system16generic_categoryEv (ie >> boost::system::generic_category() ) >> is actualy *present* in the boost library that I am linking, as show by >> the output of nm below. >> ==> the linker does not find however ! >> >> nm boost-emscripten-1.59/lib/libboost_system.a | grep >> _ZN5boost6system16generic_categoryEv >> 0000000000000000 T __ZN5boost6system16generic_categoryEv >> >> iii) Study of opencv related link errors: >> When I run nm (OSX version) on the opencv libraries I just built, I get >> no output (!). >> However, I am sure they contain many symbols, since I get many more >> link errors if I do not link with them >> >> nm opencv-emscripten-3.0/lib/libopencv_core.a >> ==> empty result` >> >> Do you have any ideas ? >> >> Regards, >> >> Pascal Thomet >> >> >> >> >> >> >> >> On Sunday, August 30, 2015 at 5:59:48 PM UTC+2, Alon Zakai wrote: >>> >>> Compiling just that code fragment works properly. Do you have a complete >>> testcase showing the issue? >>> >>> One guess is that you are linking with boost, perhaps some sort of >>> interaction between it and libc++. >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to emscripten-discuss+unsubscr...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Aidan > > Currently co-authoring a book on Docker - > http://docker-in-practice.github.io/ > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.