It is a pity that writing your own C++ programs on Windows isn't easier, 
but until a simplified method is developed the best way is to
download the whole project from SVN. (I use TortoiseSVN 
http://tortoisesvn.net.) You could checkout the 2.3.2 branch 
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/branches/openbabel-2-3-x,
 
or possibly the development code 
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk.

These contain a openbabel.snl file for Visual Studio 2010 (or later) in 
\windows-vc2008\build\ (ignore the name!) that contains a lot of 
projects with all the include and link dependencies in them. You will 
need to build at least the openbabel project. You could use of of the 
simpler one (e.g. obdistgen) as a template for your code, possibly by 
duplicating and renaming the project file.

Linking to an existing DLL (like openbabel-2.dll) requires a .lib file 
that was made in the same build, and such files are not distributed at 
present.

Good luck

Chris

On 09/01/2013 09:43, Ling Chan wrote:
> Good morning.
>
> I have a C++ program which makes calls to the OpenBabel library.
> Just wonder how can I compile it under Windows 7? I've already
> got OpenBabel-2.3.2 installed and have checked that the basic
> commands work. I am basically looking for something like the
> "How to compile against the Open Babel library" section at
> http://open-babel.readthedocs.org/en/latest/UseTheLibrary/CppExamples.html
> but one which refers to the Microsoft Visual C++ studio (MSVC)
> instead of to a unix-like environment.
>
> Actually I've managed to set up a project in MSVC. I think I've
> managed to add to the "include" path by:
>    Right clicking on the project name in "Solution Explorer" and
>    choose "References ..." to bring up the project's
>    "Property Pages", then on the left window choose
>    "Configuration Properties" >> "C/C++" >> "General", then
>    edit the first entry which is "Additional Include Directories".
> However, I have not figured out how to refer to the dll (I suppose
> it is the openbabel-2.dll ?) on MSVC. How can I refer to the dll
> in MSVC?
>
> Many thanks for your help!
>
> Ling Chan
>
>
>
> --
> View this message in context: 
> http://forums.openbabel.org/How-to-Compile-on-Windows-against-the-OpenBabel-Library-tp4655865.html
> Sent from the General discussion mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>


------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to