Greg,
Thanks. Your suggestion solves my problem. I add the following part in my
compiling command.
-L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib
-lInChi -lGraphMol -lRDGeneral
and the complete compiling command is
g++ -Wall -O2 -std=c++11 -I
/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I
/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I
/usr/local/Cellar/boost/1.60.0_1/include
-L/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib -lRDInchiLib
-lInChi -lGraphMol -lRDGeneral -o MYTEST main.cpp
Is there a way to figure out which library I should link? Actually, my
backup plan is to link all libraries in
/Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/lib
By the way, is there a way to guarantee that users using my binary file
(e.g. MYTEST in this case) do not need to install RDKit? I tried -static,
but it didn't work. For example, I hope a user can run MYTEST on another
Mac without RDKit.
Again, thank you very much for your help!
Yingfeng
On Fri, Mar 11, 2016 at 11:48 PM, Greg Landrum <greg.land...@gmail.com>
wrote:
> Yingfeng,
>
> you have forgotten to link against the rdkit libraries. If you are using
> the InChI code, you need to link against: RDInchiLib, InChi, GraphMol, and
> RDGeneral. There may be a few others as well.
>
> -greg
>
>
>
>
>
> On Sat, Mar 12, 2016 at 5:13 AM, Yingfeng Wang <ywang...@gmail.com> wrote:
>
>> After installing RDKit, I try to compile the following code in main.cpp,
>>
>> #include <iostream>
>> #include <INCHI-API/inchi.h>
>>
>> using namespace RDKit;
>> using namespace std;
>>
>> int main(int argc, const char * argv[]) {
>> string curInchi =
>> "InChI=1S/C10H9N3O/c1-7-11-10(14)9(13-12-7)8-5-3-2-4-6-8/h2-6H,1H3,(H,11,12,14)";
>> InchiToInchiKey(curInchi);
>> //cout << "Hello, World!" << endl;
>> return 0;
>> }
>>
>> with the following command,
>>
>> g++ -Wall -O2 -std=c++11 -I
>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/Code -I
>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External -I
>> /usr/local/Cellar/boost/1.60.0_1/include -o MYTEST main.cpp
>>
>> on my maverick Macbook. The RDKit has been installed at
>>
>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/
>>
>> while boost is at
>> /usr/local/Cellar/boost/1.60.0_1/
>>
>> The compiler information is
>>
>> g++ -v
>> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
>> --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
>> Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
>> Target: x86_64-apple-darwin13.4.0
>> Thread model: posix
>>
>> However, I got the following the error message.
>>
>> Undefined symbols for architecture x86_64:
>> "RDKit::InchiToInchiKey(std::__1::basic_string<char,
>> std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
>> referenced from:
>> _main in main-dd8650.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>>
>> I am very sure inchi.h and inchi.cpp are available at
>> /Users/yingfeng/software/RDKit/rdkit-Release_2015_03_1/External/INCHI-API/
>>
>> and function
>> std::string InchiToInchiKey(const std::string &inchi)
>>
>> is defined in inchi.cpp.
>>
>> Could you please give me some hints for solving this problem?
>>
>> Thanks.
>>
>> Yingfeng
>>
>>
>> ------------------------------------------------------------------------------
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss