OBFingerprint::FindFingerprint("FP2"): Link Error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OBFingerprint::FindFingerprint("FP2"): Link Error

Rob Soe

Hi all,

I have the following code where I am looping through a sdf file and would like to generate fingerprint for each molecule.


When I compiled it, there was a link error in the end. I am using the example project setting (I already have obconvd.lib oberrorD.lib OBDLLD.lib in the project linker’s additional dependencies) which came with the openbabel package. I tried both version (2.2.1 and 2.2.3). Both failed to work.

 

/////////////////Start code///////////////////
  OBConversion conv;
  OBFingerprint* fp;
  fp = OBFingerprint::FindFingerprint("FP2");

  if (conv.SetInFormat("sdf")){ 
    OBMol mol;
    bool notAtEnd=conv.ReadFile(&mol, argv[1]);
    while (notAtEnd)  
    {
        cout << mol.GetTitle() << '\t';
        vector<unsigned int> fpVec;
         
        fp->GetFingerprint(&mol, fpVec);
       
        mol.Clear();
        notAtEnd=conv.Read(&mol);
    }//while (notAtEnd) 
  }//if (conv.Set...)

/////////////////////End code///////////////////////////

 

Link error:

1>Compiling...

1>example1.cpp

1>Linking...

1>example1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class OpenBabel::OBFingerprint * __cdecl OpenBabel::OBFingerprint::FindFingerprint(char const *)" (__imp_?FindFingerprint@OBFingerprint@OpenBabel@@SAPAV12@PBD@Z)

1>..\debug/example1.exe : fatal error LNK1120: 1 unresolved externals

 

 

May I know how I can solve the problem?

 

Thank you very much,
Rob


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: OBFingerprint::FindFingerprint("FP2"): Link Error

Chris Morley-3
Rob Soe wrote:

> Hi all,
>
> I have the following code where I am looping through a sdf file and
> would like to generate fingerprint for each molecule.
>
>
> When I compiled it, there was a link error in the end. I am using the
> example project setting (I already have obconvd.lib oberrorD.lib
> OBDLLD.lib in the project linker’s additional dependencies) which came
> with the openbabel package. I tried both version (2.2.1 and 2.2.3). Both
> failed to work.
>
> 1>example1.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class OpenBabel::OBFingerprint *
> __cdecl OpenBabel::OBFingerprint::FindFingerprint(char const *)"
> (__imp_?FindFingerprint@OBFingerprint@OpenBabel@@SAPAV12@PBD@Z)
>
> 1>..\debug/example1.exe : fatal error LNK1120: 1 unresolved externals
>
I assume you are building using Visual Studio. On this platform in
v2.2.3 the code is in several modules built as separate DLLs(*.obf).
You are nearly there: add OBFPRT.lib or OBFPRTD.lib to your Additional
Dependencies in the Input section of the Linker Configuration Properties.

Chris

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: OBFingerprint::FindFingerprint("FP2"): Link Error

Rob Soe
Thank you Chris. You're right. I am using VS2005. The link error is now gone.

I couldn't find the OBFPRT.lib but adding OBFPRTD.lib to my project linker's directories list solved the link error.

Is that OBFPRT.lib produced by any project in the OpenBabelOBF.sln? I realized "OBFPRT" project produced the OBFPRTD.lib.

My another general question is where to find zlib.h, zconf.h, iconv.h files. I realized I needed these files when compiling to generate the lib files, but I was lucky to have them in my previous version folder.

Thanks a lot,
Rob

On Wed, Mar 10, 2010 at 4:26 AM, Chris Morley <[hidden email]> wrote:
Rob Soe wrote:
Hi all,

I have the following code where I am looping through a sdf file and would like to generate fingerprint for each molecule.


When I compiled it, there was a link error in the end. I am using the example project setting (I already have obconvd.lib oberrorD.lib OBDLLD.lib in the project linker’s additional dependencies) which came with the openbabel package. I tried both version (2.2.1 and 2.2.3). Both failed to work.

1>example1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class OpenBabel::OBFingerprint * __cdecl OpenBabel::OBFingerprint::FindFingerprint(char const *)" (__imp_?FindFingerprint@OBFingerprint@OpenBabel@@SAPAV12@PBD@Z)

1>..\debug/example1.exe : fatal error LNK1120: 1 unresolved externals

I assume you are building using Visual Studio. On this platform in v2.2.3 the code is in several modules built as separate DLLs(*.obf). You are nearly there: add OBFPRT.lib or OBFPRTD.lib to your Additional Dependencies in the Input section of the Linker Configuration Properties.

Chris


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: OBFingerprint::FindFingerprint("FP2"): Link Error

Chris Morley-3
Rob Soe wrote:
> Thank you Chris. You're right. I am using VS2005. The link error is now
> gone.
>
> I couldn't find the OBFPRT.lib but adding OBFPRTD.lib to my project
> linker's directories list solved the link error.
>
> Is that OBFPRT.lib produced by any project in the OpenBabelOBF.sln? I
> realized "OBFPRT" project produced the OBFPRTD.lib.

Yes. They are produced from the "Debug" and the "Release" builds.
>
> My another general question is where to find zlib.h, zconf.h, iconv.h
> files. I realized I needed these files when compiling to generate the
> lib files, but I was lucky to have them in my previous version folder.

Doing C++ programming with Visual Studio, you would probably be better
off downloading all the OpenBabel files from SVN. See
http://openbabel.org/wiki/Install_%28MSVC%29. The basic build is not
too difficult; the wxWidgets GUI is more challenging.

Chris

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss