certi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [certi-dev] C++ error in VS when building certi3.5.1


From: Jean-Philippe Lebel
Subject: Re: [certi-dev] C++ error in VS when building certi3.5.1
Date: Fri, 13 Nov 2015 11:35:24 -0500

Eric,

Regarding the SocketSHMWin32 error, you are defining an overloaded destructor that define a stricker through parameter. Seems like VS2015 doesn't like that. This is probably related to that fact

"In C++11, destructors are implicitly throw() (unless any member or base of the type has a destructor with a different exception specification)"

Personally, I would define the destructor without any   statement considering throwing in a destructor is dangerous

Finally, the ostream error is related to the new behaviors of ostream in  c++11 (ref http://www.cplusplus.com/reference/ostream/ostream/operator-free/), especially
 "
rvalue insertion (3)
template<class charT, class traits, class T>
basic_ostream<charT,traits>&
  operator<< (basic_ostream<charT,traits>&& os, const T& val);"


I'm quite surprised I was not able to find any other reference to that issue. The way the ostream is used in Certi looks to me fairly common.




On Fri, Nov 13, 2015 at 4:29 AM, Eric Noulard <address@hidden> wrote:


2015-11-12 20:33 GMT+01:00 Jean-Philippe Lebel <address@hidden>:
** Warning ** Not the best fix!

To fix the stream error, define the overloaded function, in certi.hh (within the CERTI__HH_INCLUDED ifdef)

namespace certi { std::ostream& operator<< (std::ostream& os, std::ostream& is);
}

Place the actual code in a compiled file (in placed mine in at the top of M_Classes.cc but it should not matter)

namespace certi { std::ostream& operator<< (std::ostream& os, std::ostream& is) { return (os << is.rdbuf()); } }


I can't understand the root cause of that error... but it seems related to an addition to C++11.

This is true but I cannot understand why for now.
The errors appears with gcc and clang whenever --std=c++11 is used.

The two incriminated files are generated files so as soon as I have a "real" fix I'll regenerate and commit those
files.
 
The fix, while to pretty, does the job.

For the std::min error (in HLAbuffer.cc) just add  #include <algorithm> at the top. Same thing for ObjectClass.cc, HLAvariableArray.hh, BillardDDM.cc, 


Those are already fixed in git master.


In SocketSHMWin32.hh comment the throw line and do the same in SocketSHMWin32.cc (around line 100)

I'm blind with those two because I have no MS platform at hand for now.
What's the issue with the throw things?
 

Now it will compile. I haven't tested the resulting binary...

Good luck.




On Thu, Nov 12, 2015 at 11:52 AM, Bourbouh Hamza <address@hidden> wrote:
Hi everyone,

When I'm trying to build certi on Windows 10 with Visual Studio 13, it throws a lot of errors
For example :

9>D:\isae\certi\CERTI-3.5.1git-Source\libCERTI\M_Classes.cc(1047): error C2678: binary '<<' : no operator found which takes a left-hand operand of type
'std::basic_ostream<char,std::char_traits<char>>' (or there is no acceptable conversion)

the line of code that throws the error is :
 out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;

Waiting for your ideas what goes wrong?
Hamza

--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel




--
-------------
Jean-Philippe Lebel, Ing. MBA
ForwardSim inc
cell: 418-931-3800

--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel




--
Eric

--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel




--
-------------
Jean-Philippe Lebel, Ing. MBA
ForwardSim inc
cell: 418-931-3800

reply via email to

[Prev in Thread] Current Thread [Next in Thread]