I'll try to sort this out asap. Unfortunately, we don't have a build server
for MinGW (or indeed Cygwin) and so it tends to bit rot. It has worked in
the past though, and we should get it working again.

Actually, I just looked up AppVeyor, and it seems they also support MinGW
(as well as our current MSVC build), so if we get it going, we can ensure
that it stays working in future.

Regards,
- Noel

On 22 February 2018 at 16:34, Sébastien Le Roux <
sebastien.ler...@ipcms.unistra.fr> wrote:

> Dear all,
> same guy here trying to use the devel. lib of Openbabel for windows (msys,
> mingw64),
> thanks to Noel O'Boyle I managed to build the lib, and after that build my
> program ...
> only to see that I could not open a file using babel on windows, openbabel
> systematically
> fails on the conv.Read or conv.ReadFile instructions, and I have no clue
> why ...
> any idea to help me ?
>
> Thanks in advance for your help, again ...
>
> Best regards.
>
> Sébastien
>
> Here is my code:
>
> ------------------------------------------------------------
> -------------------------------------------------------------------
>
>  OBConversion conv;
>  std::string filename;
>
>  filename = this_file;
>  std::string fileformat;
>
>  fileformat = this_format;
>  std::ifstream ifs(filename.c_str());
>
>  if (! ifs)
> {
>   // Error reading file
>   cout<<"Reading failed";
>   return 1;
> }
>
> OBFormat * format = conv.FormatFromExt(fileformat.c_str());
> if(! conv.SetInFormat(format))
> {
>   cout<<"Set In Format failed";
>   // Error with this format
>   return 2;
> }
>
> OBMol mol;
> conv.AddOption("b", OBConversion::INOPTIONS);
>
> if (! conv.Read(& mol, &ifs))
> {
>
>  // Error reading molecule in file
>  cout<<"Reading molecule failed";
>
>  // It always return at this point ...
>  // Note that before I tried to open the file using "ReadFile (&mol,
> filename.c_str()))"
>  // the result was the same.
>
>  return 3;
> }
>
> if (mol.HasData(OBGenericDataType::UnitCell))
> {
>   OBUnitCell * uc = (OBUnitCell *)mol.GetData(OBGenericDataTyp
> e::UnitCell);
>   if (strcmp(this_format, "cif")  == 0) uc -> FillUnitCell (&mol);
> }
>
>
> ------------------------------------------------------------
> -------------------------------------------------------------------
>
> --
> ===========================================================
> Dr. Sébastien Le Roux
> Ingénieur de Recherche CNRS
> Institut de Physique et Chimie des Matériaux de Strasbourg
> Département des Matériaux Organiques
> 23, rue du Loess
> <https://maps.google.com/?q=23,+rue+du+Loess&entry=gmail&source=g>
> BP 43
> F-67034 Strasbourg Cedex 2, France
> E-mail: sebastien.ler...@ipcms.unistra.fr
> Webpage: http://www.ipcms.unistra.fr/?page_id=14965&lang=en
> RINGS project: http://rings-code.sourceforge.net/
> ISAACS project: http://isaacs.sourceforge.net/
> Fax:   +33 3 88 10 72 46
> Phone: +33 3 88 10 71 58
> ===========================================================
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to