After fixing this and installing all the dependencies I stopped at the following:
acprep: INFO: System type is => CYGWIN_NT-6.1-WOW64 acprep: INFO: Setting up build flavor => debug -- Configuring done -- Generating done -- Build files have been written to: /cygdrive/c/Users/anton/projects/ledger/bui ld/ledger/debug [ 1%] Generating ../system.hh.gch Scanning dependencies of target libledger [ 3%] Building CXX object src/CMakeFiles/libledger.dir/stats.cc.o In file included from /cygdrive/c/Users/anton/projects/ledger/src/stats.cc:38:0:
/cygdrive/c/Users/anton/projects/ledger/src/report.h: In constructor 'ledger::report_t::pager_option_t::pager_option_t()': /cygdrive/c/Users/anton/projects/ledger/src/report.h:788:3: error: 'setenv' wasnot declared in this scope src/CMakeFiles/libledger.dir/build.make:54: recipe for target `src/CMakeFiles/libledger.dir/stats.cc.o' failed make[2]: *** [src/CMakeFiles/libledger.dir/stats.cc.o] Error 1 CMakeFiles/Makefile2:112: recipe for target `src/CMakeFiles/libledger.dir/all' failed make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2 Makefile:143: recipe for target `all' failed make: *** [all] Error 2 acprep: ERROR: Execution failed: make
The "setenv" in question is in the report.h, line 800.
I noticed std::getenv few lines above and decided to try std::setenv :)
Doesn't work - it says "setenv is not a member of std". I haven't programmed in C++ for maybe 6 years, so I don't know.
Just commented out the setenv call. Compilation proceeded with two warnings and finally stopped with error:
[ 38%] Building CXX object src/CMakeFiles/libledger.dir/textual.cc.o In file included from /cygdrive/c/Users/anton/projects/ledger/src/textual.cc:41: 0: /cygdrive/c/Users/anton/projects/ledger/src/pstream.h: In member function 'virtu al std::basic_streambuf<char>::pos_type ptristream::ptrinbuf::seekoff(std::basic _streambuf<char, std::char_traits<char> >::off_type, std::ios_base::seekdir, std ::ios_base::openmode)': /cygdrive/c/Users/anton/projects/ledger/src/pstream.h:86:14: warning: enumeratio n value '_S_ios_seekdir_end' not handled in switch
[ 52%] Building CXX object src/CMakeFiles/libledger.dir/format.cc.o In file included from /cygdrive/c/Users/anton/projects/ledger/src/format.cc:36:0 : /cygdrive/c/Users/anton/projects/ledger/src/pstream.h: In member function 'virtu al std::basic_streambuf<char>::pos_type ptristream::ptrinbuf::seekoff(std::basic _streambuf<char, std::char_traits<char> >::off_type, std::ios_base::seekdir, std ::ios_base::openmode)': /cygdrive/c/Users/anton/projects/ledger/src/pstream.h:86:14: warning: enumeratio n value '_S_ios_seekdir_end' not handled in switch
[ 67%] Building CXX object src/CMakeFiles/libledger.dir/quotes.cc.o /cygdrive/c/Users/anton/projects/ledger/src/quotes.cc: In function 'boost::optio nal<ledger::price_point_t> ledger::commodity_quote_from_script(ledger::commodity _t&, const ledger::commodity_t*)': /cygdrive/c/Users/anton/projects/ledger/src/quotes.cc:66:50: error: 'popen' was not declared in this scope /cygdrive/c/Users/anton/projects/ledger/src/quotes.cc:69:18: error: 'pclose' was not declared in this scope src/CMakeFiles/libledger.dir/build.make:951: recipe for target `src/CMakeFiles/l ibledger.dir/quotes.cc.o' failed make[2]: *** [src/CMakeFiles/libledger.dir/quotes.cc.o] Error 1 CMakeFiles/Makefile2:112: recipe for target `src/CMakeFiles/libledger.dir/all' f ailed make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2 Makefile:143: recipe for target `all' failed make: *** [all] Error 2 acprep: ERROR: Execution failed: make
at the quotes.cc, line 65 the compilation proceeded until:
[ 15%] Building CXX object src/CMakeFiles/libledger.dir/times.cc.o /cygdrive/c/Users/anton/projects/ledger/src/times.cc: In member function 'T ledg er::<unnamed>::temporal_io_t<T, InputFacetType, OutputFacetType>::parse(const ch ar*) [with T = boost::posix_time::ptime, InputFacetType = boost::date_time::time _input_facet<boost::posix_time::ptime, char>, OutputFacetType = boost::date_time ::time_facet<boost::posix_time::ptime, char>]': /cygdrive/c/Users/anton/projects/ledger/src/times.cc:141:45: error: 'strptime' w as not declared in this scope /cygdrive/c/Users/anton/projects/ledger/src/times.cc: In member function 'T ledg er::<unnamed>::temporal_io_t<T, InputFacetType, OutputFacetType>::parse(const ch ar*) [with T = boost::gregorian::date, InputFacetType = boost::date_time::date_i nput_facet<boost::gregorian::date, char>, OutputFacetType = boost::date_time::da te_facet<boost::gregorian::date, char>]': /cygdrive/c/Users/anton/projects/ledger/src/times.cc:178:45: error: 'strptime' w as not declared in this scope /cygdrive/c/Users/anton/projects/ledger/src/times.cc:183:3: warning: control rea ches end of non-void function /cygdrive/c/Users/anton/projects/ledger/src/times.cc: In member function 'T ledg er::<unnamed>::temporal_io_t<T, InputFacetType, OutputFacetType>::parse(const ch ar*) [with T = boost::posix_time::ptime, InputFacetType = boost::date_time::time _input_facet<boost::posix_time::ptime, char>, OutputFacetType = boost::date_time ::time_facet<boost::posix_time::ptime, char>]': /cygdrive/c/Users/anton/projects/ledger/src/times.cc:146:3: warning: control rea ches end of non-void function src/CMakeFiles/libledger.dir/build.make:1135: recipe for target `src/CMakeFiles/ libledger.dir/times.cc.o' failed make[2]: *** [src/CMakeFiles/libledger.dir/times.cc.o] Error 1 CMakeFiles/Makefile2:112: recipe for target `src/CMakeFiles/libledger.dir/all' f ailed make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2 Makefile:143: recipe for target `all' failed make: *** [all] Error 2 acprep: ERROR: Execution failed: make
I am not sure what to do. Commenting time parsing doesn't seem to be reasonable approach - Ledger will become not functional without times. Specify USE_BOOST_FACETS? How? Or maybe cygwing has strptime in a different headers than other systems? I don't know.
I successfully built ledger 3 on cygwin back in April, before the changeover to CMake. I put the exe and (I think all) the necessary dlls up here: http://dl.dropbox.com/u/1925545/ledger3-cygwin-201204.zip . I'm prepared to say that it works for me, but that's about it.
With the old build system, compiling with Cygwin pretty much just worked; I wonder if CMake is targeting win32, when it maybe should be targeting Cygwin.
> Exception during initialization: locale::facet::_S_create_c_locale name > not valid > 1 [main] ledger 7960 exception::handle: Exception: > STATUS_ACCESS_VIOLATION > 2433 [main] ledger 7960 open_stackdumpfile: Dumping stack trace to > ledger.exe.stackdump
> Can you advice how to workaround this issue with locales?
> Best regards, > - Anton
Hi Anton-
Do you have LANG or other locale related environment variables set? I had some issues with locale related crashes but stopped looking into it after I found that setting LANG = "" worked around them (my Windows environment doesn't have LANG set, I had to do this to get things working under Cygwin bash...).
ledger.exe.stackdump file produced by this version also doesn't contain stacktrace.
Ok, so I am limited to starting bash before using ledger. It's better than starting a
separate virtual machine. I think I can live with this. Thanks again for the binary.
As a bottom line of the locale-related crash. It is strange.
I have set all these Cygwin variables to the same values on windows,
so that result is the same both when I run locale from windows command
line and from cygwin bash.
So, _without_ any locale related variables ledger works for you (in particular in windows command line), while _with_ locale variables it crashes (in bash).
I have just carefully deleted all the locale related variables from Windows settings and ledger works for me without cygwin bash!