<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 1, 2009, at 6:36 AM, 罗勇刚(Yonggang Luo) wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>At the first glance,  it's coming with that c-index-test is just only containing c files (without cpp(cxx,c++) files).</div><div><br></div><div>So cmake recognize it as pure C project,</div><div>and so it's link options that resident in link.txt is</div>

<div><b>/usr/bin/gcc</b>     CMakeFiles/c-index-test.dir/c-index-test.c.o  -o ../../../../bin/c-index-test -rdynamic ../../../../lib/libCIndex.so ../../../../lib/libclangIndex.a ../../../../lib/libclangFrontend.a ../../../../lib/libclangSema.a ../../../../lib/libclangAST.a ../../../../lib/libclangLex.a ../../../../lib/libclangBasic.a ../../../../lib/libLLVMBitReader.a ../../../../lib/libLLVMMC.a ../../../../lib/libLLVMCore.a ../../../../lib/libLLVMSupport.a ../../../../lib/libLLVMSystem.a -ldl -lpthread -Wl,-rpath,/home/dreamkxd/llvm/lib </div>

<div><br></div><div>And so, it's won't linkage with C++ library. So it's failure to compiling the c-index-test project</div><div><br></div><div>Is there any solution to this problem?</div></blockquote></div><br><div>You're building using CMake? Try modifying tools/CIndex/CMakeLists.txt by adding the following command at the end:</div><div><br></div><div>  set_target_properties(CIndex</div><div>    PROPERTIES</div><div>    LINKER_LANGUAGE CXX)</div><div><br></div><div>If that works for you, please tell me so I can commit the change to svn.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>