Fantastic that got me past the system lib issue.  Now when I compile using 
emscripten-fastcompiler clang++ I have no issues.  I can also compile to 
bitcode without issues.

$ /dist/emscripten-fastcomp/build/bin/clang++ -emit-llvm -c test.cpp -o 
test.bc -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
  
-I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_highgui
clang-3.3: warning: -lopencv_core: 'linker' input unused
clang-3.3: warning: -lopencv_highgui: 'linker' input unused

clang-3.3: warning: argument unused during compilation: '-L/usr/local/lib'
When I try to compile the bitcode to javascript I get some unresolved 
symbols.  I have used the emscripten-fastcompiler in the entire build 
chain, including building opencv.  So I must be missing a step in building 
the opencv libraries.  Is the problem the absolute paths as it states in 
the warning?  The output looks like those libraries are being processed but 
still I have the unresolved symbols.

$ EMCC_FAST_COMPILER=1 em++ test.bc -o a.out.html -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
  
-I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_highgui -v
WARNING  root: -I or -L of an absolute path "-I/usr/local/include" 
encountered. If this is to a local system header/library, it may cause 
problems (local system files make sense for compiling natively on your 
system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' 
to emcc to hide this warning.
DEBUG    root: invocation: /dist/emscripten/emcc test.bc -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
 
-I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_highgui -v
DEBUG    root: looking for library "opencv_core"
DEBUG    root: found library "opencv_core" at 
/usr/local/lib/libopencv_core.dylib
DEBUG    root: looking for library "opencv_highgui"
DEBUG    root: found library "opencv_highgui" at 
/usr/local/lib/libopencv_highgui.dylib
DEBUG    root: compiling to bitcode
DEBUG    root: emcc step "parse arguments and setup" took 0.00 seconds
DEBUG    root: copying bitcode file: test.bc
DEBUG    root: copying library file: /usr/local/lib/libopencv_core.dylib
DEBUG    root: copying library file: /usr/local/lib/libopencv_highgui.dylib
DEBUG    root: emcc step "bitcodeize inputs" took 0.01 seconds
DEBUG    root: emcc step "bitcodeize inputs" took 0.00 seconds
DEBUG    root: will generate JavaScript
DEBUG    root: emcc step "calculate system libraries" took 0.03 seconds
DEBUG    root: linking: ['/tmp/tmpGSPU8n/test_0.o', 
'/tmp/tmpGSPU8n/libopencv_core_1.dylib', 
'/tmp/tmpGSPU8n/libopencv_highgui_2.dylib']
DEBUG    root: emcc: llvm-linking: ['/tmp/tmpGSPU8n/test_0.o'] to 
/tmp/tmpGSPU8n/a.out.bc
DEBUG    root: emcc step "link" took 0.00 seconds
DEBUG    root: saving intermediate processing steps to /tmp/emscripten_temp
DEBUG    root: emcc: LLVM opts: -internalize 
-internalize-public-api-list=main,malloc,free -globaldce 
-pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt 
-enable-emscripten-cxx-exceptions
DEBUG    root: emcc step "post-link" took 0.01 seconds
DEBUG    root: LLVM => JS
DEBUG    root: emscript: llvm backend: 
/dist/emscripten-fastcomp/build/bin/llc /tmp/tmpGSPU8n/a.out.bc -march=js 
-filetype=asm -o /tmp/emscripten_temp/tmpFueiRS.4.js
warning: incorrect target triple 'x86_64-apple-macosx10.9.0' (did you use 
emcc/em++ on all source files and not clang directly?)
DEBUG    root:   emscript: llvm backend took 0.00547194480896 seconds
DEBUG    root: emscript: js compiler glue











*warning: unresolved symbol: _ZN2cv3Mat10deallocateEvwarning: unresolved 
symbol: _ZNSt8ios_base4InitD1Evwarning: unresolved symbol: 
_ZNSt8ios_base4InitC1Evwarning: unresolved symbol: 
_ZN2cv6String8allocateEmwarning: unresolved symbol: _ZNSolsEmwarning: 
unresolved symbol: 
_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_warning: 
unresolved symbol: 
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKcwarning: unresolved 
symbol: _ZN2cv8fastFreeEPvwarning: unresolved symbol: 
_ZNSolsEPFRSoS_Ewarning: unresolved symbol: 
_ZN2cv6imreadERKNS_6StringEiwarning: unresolved symbol: 
_ZN2cv6String10deallocateEvwarning: unresolved symbol: _ZSt4cout*
DEBUG    root:   emscript: glue took 0.188182830811 seconds
DEBUG    root: asm text sizes[[10340, 17544, 25], 2680, 264, 2449, 0, 751, 
1669, 610, 234, 1883, 632]
DEBUG    root:   emscript: final python processing took 0.00489711761475 
seconds
DEBUG    root: emcc step "emscript (llvm=>js)" took 0.27 seconds
DEBUG    root: emcc step "source transforms" took 0.00 seconds
DEBUG    root: emcc step "js opts" took 0.00 seconds
DEBUG    root: generating HTML
DEBUG    root: emcc step "final emitting" took 0.05 seconds

DEBUG    root: total time: 0.38 seconds


On Wednesday, April 16, 2014 1:31:27 AM UTC-6, jj wrote:
>
> You are hitting a OSX-specific clang issue that one needs to specify which 
> OSX SDK is being targeted. This is done via a -isysroot /path/to/xcode/sdk 
> directive to clang. It is possible to hardcode a default path to clang 
> during build, which is what system clang has done. See this commit for 
> emscripten unit test runner, which does the same in a case where it wants 
> to use the custom-built clang to build a native executable: 
> https://github.com/kripken/emscripten/commit/b239fb1ed3d91bd98ddafa1bfd6af6a57daa32ca
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to