Re: Squid 3 build error using Visual Studio
Hi Alex, At 18.43 13/08/2007, Alex Rousskov wrote: This is with the code recently synced with HEAD, right? Please try the attached untested patch. It follows the suggestions at the page found by Amos: http://www.codecomments.com/archive292-2005-2-396222.html Yes, it works. Thanks. Thanks for the link, but, I have really understand nothing :-( Really I hate C++ :-( Is it a good idea to hate something you do not understand? :-) Alex, let me to explain my situation. Principally I'm an IT consultant working (busy at 110% of my time) on Systems Administration and Systems Deployment, while I became a Squid developer mainly for my personal hobby. I have learned at university (more than 15 years ago ...) Assembler, Fortran, C and Pascal, but never C++. or any similar language. I'm not a wizard of C language programming or a Squid guru like Henrik, but I was always able to understand what a piece of code of Squid 2 does. Now I feel really frustrated when I can't understand why a single line of code of Squid 3 doesn't build or why your patch works :-( I have also tried to learn C++ by myself, but with little result because I don't have enough time for the job. For a while I'm asking to me if is time to look for a new maintainer of the Windows port of Squid 3, and today I'm thinking that probably this time is gone ... :-( Regards Guido - Guido Serassio Acme Consulting S.r.l. - Microsoft Certified Partner Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY Tel. : +39.011.9530135 Fax. : +39.011.9781115 Email: [EMAIL PROTECTED] WWW: http://www.acmeconsulting.it/
Re: Squid 3 build error using Visual Studio
Hi Guido , Guido Serassio wrote: I have learned at university (more than 15 years ago ...) Assembler, Fortran, C and Pascal, but never C++. or any similar language. Sometimes I am feeling to old to start thinks too, but Guido if you are thinking like that now, what are we going to do after 15 years? New technologies come again and again ... Now I feel really frustrated when I can't understand why a single line of code of Squid 3 doesn't build or why your patch works :-( The major problem you may have is that c++ compilers some times return error messages which looks completely unrelated with the real problem. In your case it returned an error about std::basic_ostream where the real problem is that it can not found a destructor without arguments for std::ostream part of StoreEntryStream objects... (I had similar problem today morning trying to understand what the hell means the undefined reference to vtable for .) But I think as someones learns the compilers and tools which his is using these problems disappeared Regards, Christos
Re: Squid 3 build error using Visual Studio
On Tue, 2007-08-14 at 11:12 +0200, Guido Serassio wrote: At 18.43 13/08/2007, Alex Rousskov wrote: Is it a good idea to hate something you do not understand? :-) Alex, let me to explain my situation. Principally I'm an IT consultant working (busy at 110% of my time) on Systems Administration and Systems Deployment, while I became a Squid developer mainly for my personal hobby. I have learned at university (more than 15 years ago ...) Assembler, Fortran, C and Pascal, but never C++. or any similar language. I'm not a wizard of C language programming or a Squid guru like Henrik, but I was always able to understand what a piece of code of Squid 2 does. Now I feel really frustrated when I can't understand why a single line of code of Squid 3 doesn't build or why your patch works :-( I have also tried to learn C++ by myself, but with little result because I don't have enough time for the job. For a while I'm asking to me if is time to look for a new maintainer of the Windows port of Squid 3, and today I'm thinking that probably this time is gone ... :-( I hope you can continue to maintain the Windows port. You can always offload solving C++ puzzles to others... The specific bug you hit is with the low-level streaming code that has always been very difficult to write and port correctly because C++ libraries implemented low-level streaming interfaces differently. In your case, GCC stdlibc++ has a default std::ostream constructor while your Windows library does not, causing the compiler error. The rest is just hacks to make the existing parameterized std::ostream constructor work. And if you continue to hate C++, just wait for Squid4 in Python :-). There will be no compile-time errors then, even if half of the code is missing! Alex.
Re: Squid 3 build error using Visual Studio
On tis, 2007-08-14 at 14:10 +0300, Tsantilas Christos wrote: The major problem you may have is that c++ compilers some times return error messages which looks completely unrelated with the real problem. Or quite related but where it's impossible to grok what is related or how... http://www.henriknordstrom.net/code/loreley_warning.html (I had similar problem today morning trying to understand what the hell means the undefined reference to vtable for .) My experience: Missing object file implementing the class, only having header references. But if I hadn't known already that the vtable is what the object internal table of virtual methods is called I would not have understood that error much at all.. But I think as someones learns the compilers and tools which his is using these problems disappeared And then the tools gets upgraded and you have to learn new errors.. The problem with C++ compared to C is complexity. C++ is a fairly complex language with many levels of abstraction and a lot of hidden magics which needs to be understood apart from the syntax itself. This makes a very steep learningcurve when trying to understand existing code. Tools like doxygen helps a lot to decipher unknown code. Without them reading and understanding complex C++ code is a nightmare. But this is also where the powers of C++ lies. The abstraction levels do allows for clean code to be done easier than in for example C. The Squid-3 code is currently a bit messy with 4-5 differen generations of coding style. But gradually things do get cleaned up. And I am also looking forward to the docs project getting merged which is a significant step along that path imho. Regards Henrik signature.asc Description: This is a digitally signed message part
Re: Squid 3 build error using Visual Studio
On tis, 2007-08-14 at 14:10 +0300, Tsantilas Christos wrote: The major problem you may have is that c++ compilers some times return error messages which looks completely unrelated with the real problem. Or quite related but where it's impossible to grok what is related or how... http://www.henriknordstrom.net/code/loreley_warning.html (I had similar problem today morning trying to understand what the hell means the undefined reference to vtable for .) My experience: Missing object file implementing the class, only having header references. But if I hadn't known already that the vtable is what the object internal table of virtual methods is called I would not have understood that error much at all.. But I think as someones learns the compilers and tools which his is using these problems disappeared And then the tools gets upgraded and you have to learn new errors.. The problem with C++ compared to C is complexity. C++ is a fairly complex language with many levels of abstraction and a lot of hidden magics which needs to be understood apart from the syntax itself. This makes a very steep learningcurve when trying to understand existing code. Tools like doxygen helps a lot to decipher unknown code. Without them reading and understanding complex C++ code is a nightmare. But this is also where the powers of C++ lies. The abstraction levels do allows for clean code to be done easier than in for example C. The Squid-3 code is currently a bit messy with 4-5 differen generations of coding style. But gradually things do get cleaned up. And I am also looking forward to the docs project getting merged which is a significant step along that path imho. :-) Thanks. Even if it was your idea in the first place. Guido (or anyone); if you want to use the docs project to understand any code its public at http://squid.treenet.co.nz/Doc/Code/ Two notes though for now: - there is presently some breakage caused by those semi-colon-free macros: void orphan() {} MACRO(x) void fooBarInvisible() { orphan(); } - MACRO will screw up so docs will not include fooBarInvisible() and details for orphan() will say its never referenced. So for the present, unless a function has a docs comment or is linked from the module page directly it needs checking for use manually. Overall though its good now for a quick check of inheritance details and what belongs where. Amos
Re: Squid 3 build error using Visual Studio
On Sat, 2007-08-11 at 23:06 +0200, Serassio Guido wrote: Hi, Trying to build the current Squid 3 source using Visual Studio 2005 on Windows, I get the following error. Any C++ suggestion ? Compiling... mem.cc c:\work\nt-3.0\src\StoreEntryStream.h(119) : error C2512: 'std::basic_ostream_Elem,_Traits' : no appropriate default constructor available with [ _Elem=char, _Traits=std::char_traitschar ] This is with the code recently synced with HEAD, right? Please try the attached untested patch. It follows the suggestions at the page found by Amos: http://www.codecomments.com/archive292-2005-2-396222.html Thanks for the link, but, I have really understand nothing :-( Really I hate C++ :-( Is it a good idea to hate something you do not understand? :-) Alex. std::ostream may not have a default constructor on Windows so we need to supply a NULL buffer and then change the buffer to ours. Index: src/StoreEntryStream.h === RCS file: /cvsroot/squid/squid3/src/StoreEntryStream.h,v retrieving revision 1.4 diff -u -r1.4 StoreEntryStream.h --- src/StoreEntryStream.h 7 Aug 2007 20:02:51 - 1.4 +++ src/StoreEntryStream.h 13 Aug 2007 16:41:26 - @@ -116,7 +116,11 @@ public: /* create a stream for writing text etc into theEntry */ -StoreEntryStream(StoreEntry *entry): theBuffer(entry) { this-init(theBuffer); } +// See http://www.codecomments.com/archive292-2005-2-396222.html +StoreEntryStream(StoreEntry *entry): std::ostream(0), theBuffer(entry) { +rdbuf(theBuffer); // set the buffer to now-initialized theBuffer +clear(); //clear badbit set by calling init(0) +} private: StoreEntryStreamBuf theBuffer;
Re: Squid 3 build error using Visual Studio
Serassio Guido wrote: Hi, Trying to build the current Squid 3 source using Visual Studio 2005 on Windows, I get the following error. Any C++ suggestion ? hehe, StoreEntryStream, again. Alex just fixed the last bug in there for me, he may have better grasp of it at the moment. Here is someone else with the same problem and an answer (maybe): http://www.codecomments.com/archive292-2005-2-396222.html Compiling... mem.cc c:\work\nt-3.0\src\StoreEntryStream.h(119) : error C2512: 'std::basic_ostream_Elem,_Traits' : no appropriate default constructor available with [ _Elem=char, _Traits=std::char_traitschar ] Regards Guido - Guido Serassio Acme Consulting S.r.l. - Microsoft Certified Partner Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY Tel. : +39.011.9530135 Fax. : +39.011.9781115 Email: [EMAIL PROTECTED] WWW: http://www.acmeconsulting.it/
Re: Squid 3 build error using Visual Studio
Hi Amos, At 12.14 12/08/2007, Amos Jeffries wrote: Serassio Guido wrote: Hi, Trying to build the current Squid 3 source using Visual Studio 2005 on Windows, I get the following error. Any C++ suggestion ? hehe, StoreEntryStream, again. Alex just fixed the last bug in there for me, he may have better grasp of it at the moment. Here is someone else with the same problem and an answer (maybe): http://www.codecomments.com/archive292-2005-2-396222.html Thanks for the link, but, I have really understand nothing :-( Really I hate C++ :-( Regards Guido Compiling... mem.cc c:\work\nt-3.0\src\StoreEntryStream.h(119) : error C2512: 'std::basic_ostream_Elem,_Traits' : no appropriate default constructor available with [ _Elem=char, _Traits=std::char_traitschar ] Regards Guido - Guido Serassio Acme Consulting S.r.l. - Microsoft Certified Partner Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY Tel. : +39.011.9530135 Fax. : +39.011.9781115 Email: [EMAIL PROTECTED] WWW: http://www.acmeconsulting.it/ - Guido Serassio Acme Consulting S.r.l. - Microsoft Certified Partner Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY Tel. : +39.011.9530135 Fax. : +39.011.9781115 Email: [EMAIL PROTECTED] WWW: http://www.acmeconsulting.it/