Re: [Dclib-devel] dlib C++ library Compilation Errors
Brought to you by:
davisking
From: Davis K. <dav...@us...> - 2008-07-25 02:52:17
|
No problem. You should be able to compile the bayes_net_gu_ex in visual studio or mingw (and even cygwin now). In fact, I use it in Windows XP all the time. But I guess you are having trouble getting it compiled in Windows XP still? -Davis On Thu, Jul 24, 2008 at 10:43 PM, Nabeel Alzahrani <nza...@ho...> wrote: > Thank you so much for your help. I have tried the library with Mingw and > it is working. > Actually I need to see the GUI of the bayes network of the > "bayes_net_gui_ex" example , so it is inevitable to install Linux in my > Windows XP :-( > > Nabeel > > ------------------------------ > Date: Thu, 24 Jul 2008 20:10:26 -0400 > From: dav...@us... > To: nza...@ho...; dcl...@li... > > Subject: Re: dlib C++ library Compilation Errors > > I just installed cygwin and modified the library so that it compiles > without any of these errors. I put a snapshot of it in > http://dclib.sf.net/snapshot so you can give that copy a try. > > -Davis > > On Tue, Jul 22, 2008 at 3:42 PM, Davis King < > dav...@us...> wrote: > > Ah, it is the std::wstring. Some of the windows ports of gcc to windows > are missing the wide character stuff from the standard C++ library. You can > maybe get it working by adding a #ifdef around the offending bits of code to > disable them when they are used on the version of gcc used by cygwin 1.5. > > Or you could try using mingw. I believe it's newest version isn't missing > these things from its library. > > I'll play around with cygwin when I get some free time and see if I can't > find a workaround. But let me know if you find an easy solution :) > > -Davis > > > On Tue, Jul 22, 2008 at 3:23 PM, Nabeel Alzahrani <nza...@ho...> > wrote: > > I did not put anything into the /home/Bill/dlib/dlib folder. If I just go > to the examples folder and do ""g++ -DNO_MAKEFILE bayes_net_ex.cpp", I got > the error messages: > ------------------------------------------------------ > > Bill@pc ~ > $ ls > dlib > > Bill@pc ~ > $ cd dlib > > Bill@pc ~/dlib > $ ls > New Text Document.txt dlib documentation.html makefile.txt > bayes_net_ex.cpp docs examples project.cpp > > Bill@pc ~/dlib > $ pwd > /home/Bill/dlib > > Bill@pc ~/dlib > $ cd examples > > Bill@pc ~/dlib/examples > $ g++ -DNO_MAKEFILE bayes_net_ex.cpp > bayes_net_ex.cpp:38:30: dlib/bayes_utils.h: No such file or directory > bayes_net_ex.cpp:39:30: dlib/graph_utils.h: No such file or directory > bayes_net_ex.cpp:40:24: dlib/graph.h: No such file or directory > bayes_net_ex.cpp:41:33: dlib/directed_graph.h: No such file or directory > bayes_net_ex.cpp:45: error: expected namespace-name before ';' token > bayes_net_ex.cpp:45: error: `<type error>' is not a namespace > bayes_net_ex.cpp: In function `int main()': > bayes_net_ex.cpp:59: error: expected namespace-name before ';' token > bayes_net_ex.cpp:59: error: `<type error>' is not a namespace > bayes_net_ex.cpp:64: error: `directed_graph' undeclared (first use this > function > ) > bayes_net_ex.cpp:64: error: (Each undeclared identifier is reported only > once fo > r each function it appears in.) > bayes_net_ex.cpp:64: error: `bayes_node' undeclared (first use this > function) > bayes_net_ex.cpp:64: error: `::kernel_1a_c' has not been declared > bayes_net_ex.cpp:64: error: expected `;' before "bn" > bayes_net_ex.cpp:80: error: `bn' undeclared (first use this function) > bayes_net_ex.cpp:88: error: `set_node_num_values' undeclared (first use > this fun > ction) > bayes_net_ex.cpp:93: error: `assignment' undeclared (first use this > function) > bayes_net_ex.cpp:93: error: expected `;' before "parent_state" > bayes_net_ex.cpp:102: error: `parent_state' undeclared (first use this > function) > > bayes_net_ex.cpp:102: error: `set_node_probability' undeclared (first use > this f > unction) > bayes_net_ex.cpp:167: error: expected init-declarator before '<' token > bayes_net_ex.cpp:167: error: expected `,' or `;' before '<' token > bayes_net_ex.cpp:168: error: `join_tree_type' undeclared (first use this > functio > n) > bayes_net_ex.cpp:168: error: expected `;' before "join_tree" > bayes_net_ex.cpp:174: error: `join_tree' undeclared (first use this > function) > bayes_net_ex.cpp:174: error: `create_moral_graph' undeclared (first use > this fun > ction) > bayes_net_ex.cpp:175: error: `create_join_tree' undeclared (first use this > funct > ion) > bayes_net_ex.cpp:180: error: `bayesian_network_join_tree' undeclared (first > use > this function) > bayes_net_ex.cpp:180: error: expected `;' before "solution" > bayes_net_ex.cpp:185: error: `solution' undeclared (first use this > function) > bayes_net_ex.cpp:200: error: `set_node_value' undeclared (first use this > functio > n) > bayes_net_ex.cpp:201: error: `set_node_as_evidence' undeclared (first use > this f > unction) > bayes_net_ex.cpp:205: error: expected `;' before "solution_with_evidence" > bayes_net_ex.cpp:209: error: `solution_with_evidence' undeclared (first use > this > function) > bayes_net_ex.cpp:255: error: `bayesian_network_gibbs_sampler' undeclared > (first > use this function) > bayes_net_ex.cpp:255: error: expected `;' before "sampler" > bayes_net_ex.cpp:274: error: `sampler' undeclared (first use this function) > bayes_net_ex.cpp:276: error: `node_value' undeclared (first use this > function) > > Bill@pc ~/dlib/examples > $ > ------------------------------------------------------ > However, if I changed the paths in the bayes_net_ex.cpp file to reflect the > location of the dlib library by changing the includes to: > #include "../dlib/bayes_utils.h" > #include "../dlib/graph_utils.h" > #include "../dlib/graph.h" > #include "../dlib/directed_graph.h" > and do ""g++ -DNO_MAKEFILE bayes_net_ex.cpp", I got the error messages: > ------------------------------------------------------- > > Bill@pc ~ > $ ls > dlib > > Bill@pc ~ > $ cd dlib > > Bill@pc ~/dlib > $ ls > New Text Document.txt dlib documentation.html makefile.txt > bayes_net_ex.cpp docs examples project.cpp > > Bill@pc ~/dlib > $ cd examples > > Bill@pc ~/dlib/examples > $ g++ bayes_net_ex.cpp > In file included from ../dlib/bayes_utils/../string.h:6, > from ../dlib/bayes_utils/bayes_utils.h:8, > from ../dlib/bayes_utils.h:6, > from bayes_net_ex.cpp:38: > ../dlib/bayes_utils/../string/string.h:88: error: expected init-declarator > befor > e "cast_to_wstring" > ../dlib/bayes_utils/../string/string.h:88: error: expected `;' before > "cast_to_w > string" > ../dlib/bayes_utils/../string/string.h: In function `const T > dlib::string_cast(c > onst wchar_t*)': > ../dlib/bayes_utils/../string/string.h:214: error: `wstring' is not a > member of > `std' > In file included from ../dlib/bayes_utils/../map/../unicode.h:6, > from ../dlib/bayes_utils/../map/../serialize.h:121, > from ../dlib/bayes_utils/../map/map_kernel_1.h:11, > from ../dlib/bayes_utils/../map.h:6, > from ../dlib/bayes_utils/bayes_utils.h:9, > from ../dlib/bayes_utils.h:6, > from bayes_net_ex.cpp:38: > ../dlib/bayes_utils/../map/../unicode/unicode.h: At global scope: > ../dlib/bayes_utils/../map/../unicode/unicode.h:521: error: expected > unqualified > -id before '&' token > ../dlib/bayes_utils/../map/../unicode/unicode.h:521: error: expected `,' or > `... > ' before '&' token > ../dlib/bayes_utils/../map/../unicode/unicode.h:522: error: ISO C++ forbids > decl > aration of `parameter' with no type > ../dlib/bayes_utils/../map/../unicode/unicode.h:524: error: expected > init-declar > ator before "convert_utf32_to_wstring" > ../dlib/bayes_utils/../map/../unicode/unicode.h:524: error: expected `,' or > `;' > before "convert_utf32_to_wstring" > ../dlib/bayes_utils/../map/../unicode/unicode.h:528: error: expected > init-declar > ator before "convert_mbstring_to_wstring" > ../dlib/bayes_utils/../map/../unicode/unicode.h:528: error: expected `,' or > `;' > before "convert_mbstring_to_wstring" > ../dlib/bayes_utils/../map/../unicode/unicode.h:533: error: expected > unqualified > -id before '&' token > ../dlib/bayes_utils/../map/../unicode/unicode.h:533: error: expected `,' or > `... > ' before '&' token > ../dlib/bayes_utils/../map/../unicode/unicode.h:534: error: ISO C++ forbids > decl > aration of `parameter' with no type > In file included from ../dlib/bayes_utils/../map/map_kernel_1.h:11, > from ../dlib/bayes_utils/../map.h:6, > from ../dlib/bayes_utils/bayes_utils.h:9, > from ../dlib/bayes_utils.h:6, > from bayes_net_ex.cpp:38: > ../dlib/bayes_utils/../map/../serialize.h:738: error: expected > unqualified-id be > fore '&' token > ../dlib/bayes_utils/../map/../serialize.h:738: error: expected `,' or `...' > befo > re '&' token > ../dlib/bayes_utils/../map/../serialize.h:741: error: ISO C++ forbids > declaratio > n of `parameter' with no type > ../dlib/bayes_utils/../map/../serialize.h: In function `void > dlib::serialize(int > )': > ../dlib/bayes_utils/../map/../serialize.h:742: error: `item' undeclared > (first u > se this function) > ../dlib/bayes_utils/../map/../serialize.h:742: error: (Each undeclared > identifie > r is reported only once for each function it appears in.) > ../dlib/bayes_utils/../map/../serialize.h:743: error: `out' undeclared > (first us > e this function) > ../dlib/bayes_utils/../map/../serialize.h: At global scope: > ../dlib/bayes_utils/../map/../serialize.h:752: error: variable or field > `deseria > lize' declared void > ../dlib/bayes_utils/../map/../serialize.h:752: error: `dlib::deserialize' > declar > ed as an `inline' variable > ../dlib/bayes_utils/../map/../serialize.h:752: error: `int > dlib::deserialize' re > declared as different kind of symbol > ../dlib/bayes_utils/../map/../serialize.h:677: error: previous declaration > of `t > emplate<class T, class alloc> void dlib::deserialize(std::vector<_Tp, > _Alloc>&, > std::istream&)' > ../dlib/bayes_utils/../map/../serialize.h:752: error: declaration of `int > dlib:: > deserialize' > ../dlib/bayes_utils/../map/../serialize.h:677: error: conflicts with > previous de > claration ` namespace dlib { }::deserialize' > ../dlib/bayes_utils/../map/../serialize.h:753: error: `wstring' is not a > member > of `std' > ../dlib/bayes_utils/../map/../serialize.h:753: error: `item' was not > declared in > this scope > ../dlib/bayes_utils/../map/../serialize.h:754: error: expected > primary-expressio > n before '&' token > ../dlib/bayes_utils/../map/../serialize.h:755: error: `in' was not declared > in t > his scope > ../dlib/bayes_utils/../map/../serialize.h:756: error: initializer > expression lis > t treated as compound expression > ../dlib/bayes_utils/../map/../serialize.h:756: error: expected `,' or `;' > before > '{' token > > Bill@pc ~/dlib/examples > $ > ------------------------------------------------------- > ------------------------------ > Date: Tue, 22 Jul 2008 07:16:09 -0400 > From: dav...@us... > To: nza...@ho... > Subject: Re: dlib C++ library Compilation Errors > CC: dcl...@li... > > > Don't put anything into the /home/Bill/dlib/dlib folder. That is probably > your problem. Try just going into the examples folder and doing "g++ > -DNO_MAKEFILE bayes_net_ex.cpp -I ..". > > You might also get linker errors about gdi32, comctl32, user32, ws2_32, or > imm32. So if that happens try adding -l gdi32 -l imm32, etc... > > Let me know if that doesn't fix your problem. > > -Davis > > On Tue, Jul 22, 2008 at 3:35 AM, Nabeel Alzahrani <nza...@ho...> > wrote: > > > Hello Davis > > I tried to run the example bayes_net_ex.cpp but I got many error messages. > I am using Cygwin version 1.5.25 (you can tell using the command uname -r) > under Windows XP Home edition with service pack 3. > I downloaded the library to a folder named dlib, so I have the following > folders: > /home/Bill/dlib/dlib > /home/Bill/dlib/docs > /home/Bill/dlib/examples > I moved the example bayes_net_ex.cpp from the folder > /home/Bill/dlib/examples to the folder /home/Bill/dlib/dlib and compiled it > using the command g++ bayes_net_ex.cpp and gcc bayes_net_ex.cpp with and > without using the compiler director #define NO_MAKEFILE as the first line. > > The error messages are: > $ g++ bayes_net_ex.cpp > > -------------------------------------------------------------------------------------------------------- > In file included from > dlib/bayes_utils/../string.h:6, > > > from > dlib/bayes_utils/bayes_utils.h:8, > > > from > dlib/bayes_utils.h:6, > > > from > bayes_net_ex.cpp:39: > > > dlib/bayes_utils/../string/string.h:88: > error: expected init-declarator before " > > > cast_to_wstring" > > > dlib/bayes_utils/../string/string.h:88: > error: expected `;' before "cast_to_wstr > > > ing" > > > dlib/bayes_utils/../string/string.h: In > function `const T dlib::string_cast(cons > > > t wchar_t*)': > > > dlib/bayes_utils/../string/string.h:214: > error: `wstring' is not a member of `st > > > d' > > > In file included from > dlib/bayes_utils/../map/../unicode.h:6, > > > from > dlib/bayes_utils/../map/../serialize.h:121, > > > from > dlib/bayes_utils/../map/map_kernel_1.h:11, > > > from > dlib/bayes_utils/../map.h:6, > > > from > dlib/bayes_utils/bayes_utils.h:9, > > > from > dlib/bayes_utils.h:6, > > > from > bayes_net_ex.cpp:39: > > > dlib/bayes_utils/../map/../unicode/unicode.h: > At global scope: > > > dlib/bayes_utils/../map/../unicode/unicode.h:521: > error: expected unqualified-id > > > before '&' token > > > dlib/bayes_utils/../map/../unicode/unicode.h:521: > error: expected `,' or `...' b > > > efore '&' token > > > dlib/bayes_utils/../map/../unicode/unicode.h:522: > error: ISO C++ forbids declara > > > tion of `parameter' with no type > > > dlib/bayes_utils/../map/../unicode/unicode.h:524: > error: expected init-declarato > > > r before "convert_utf32_to_wstring" > > > dlib/bayes_utils/../map/../unicode/unicode.h:524: > error: expected `,' or `;' bef > > > ore "convert_utf32_to_wstring" > > > dlib/bayes_utils/../map/../unicode/unicode.h:528: > error: expected init-declarato > > > r before "convert_mbstring_to_wstring" > > > dlib/bayes_utils/../map/../unicode/unicode.h:528: > error: expected `,' or `;' bef > > > ore "convert_mbstring_to_wstring" > > > dlib/bayes_utils/../map/../unicode/unicode.h:533: > error: expected unqualified-id > > > before '&' token > > > dlib/bayes_utils/../map/../unicode/unicode.h:533: > error: expected `,' or `...' b > > > efore '&' token > > > dlib/bayes_utils/../map/../unicode/unicode.h:534: > error: ISO C++ forbids declara > > > tion of `parameter' with no type > > > In file included from > dlib/bayes_utils/../map/map_kernel_1.h:11, > > > from > dlib/bayes_utils/../map.h:6, > > > from > dlib/bayes_utils/bayes_utils.h:9, > > > from > dlib/bayes_utils.h:6, > > > from > bayes_net_ex.cpp:39: > > > dlib/bayes_utils/../map/../serialize.h:738: > error: expected unqualified-id befor > > > e '&' token > > > dlib/bayes_utils/../map/../serialize.h:738: > error: expected `,' or `...' before > > > '&' token > > > dlib/bayes_utils/../map/../serialize.h:741: > error: ISO C++ forbids declaration o > > > f `parameter' with no type > > > dlib/bayes_utils/../map/../serialize.h: > In function `void dlib::serialize(int)': > > > > > > dlib/bayes_utils/../map/../serialize.h:742: > error: `item' undeclared (first use > > > this function) > > > dlib/bayes_utils/../map/../serialize.h:742: > error: (Each undeclared identifier i > > > s reported only once for each function > it appears in.) > > > dlib/bayes_utils/../map/../serialize.h:743: > error: `out' undeclared (first use t > > > his function) > > > dlib/bayes_utils/../map/../serialize.h: > At global scope: > > > dlib/bayes_utils/../map/../serialize.h:752: > error: variable or field `deserializ > > > e' declared void > > > dlib/bayes_utils/../map/../serialize.h:752: > error: `dlib::deserialize' declared > > > as an `inline' variable > > > dlib/bayes_utils/../map/../serialize.h:752: > error: `int dlib::deserialize' redec > > > lared as different kind of symbol > > > dlib/bayes_utils/../map/../serialize.h:677: > error: previous declaration of `temp > > > late void > dlib::deserialize(std::vector&, std > > > ::istream&)' > > > dlib/bayes_utils/../map/../serialize.h:752: > error: declaration of `int dlib::des > > > erialize' > > > dlib/bayes_utils/../map/../serialize.h:677: > error: conflicts with previous decla > > > ration ` namespace dlib { > }::deserialize' > > > dlib/bayes_utils/../map/../serialize.h:753: > error: `wstring' is not a member of > > > `std' > > > dlib/bayes_utils/../map/../serialize.h:753: > error: `item' was not declared in th > > > is scope > > > dlib/bayes_utils/../map/../serialize.h:754: > error: expected primary-expression b > > > efore '&' token > > > dlib/bayes_utils/../map/../serialize.h:755: > error: `in' was not declared in this > > > scope > > > dlib/bayes_utils/../map/../serialize.h:756: > error: initializer expression list t > > > reated as compound expression > > > dlib/bayes_utils/../map/../serialize.h:756: > error: expected `,' or `;' before '{ > > > ' token > > > > > > > > > _________________________________________________________________ > Time for vacation? WIN what you need- enter now! > http://www.gowindowslive.com/summergiveaway/?ocid=tag_jlyhm > > > > ------------------------------ > Time for vacation? WIN what you need. Enter Now!<http://www.gowindowslive.com/summergiveaway/?ocid=tag_jlyhm> > > > > > ------------------------------ > With Windows Live for mobile, your contacts travel with you. Connect on > the go.<http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008> > |