Archived
ICE 3.5.1 visual studio 2015 compile C4275 warning
While compiling my project (I inherited it, so I don't know too many details), I receive the following warnings:
1>c:\program files (x86)\zeroc\ice-3.5.1\include\iceutil\exception.h(21): warning C4275: non dll-interface class 'std::exception' used as base for dll-interface class 'IceUtil::Exception'
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_exception.h(43): note: see declaration of 'std::exception'
1> c:\program files (x86)\zeroc\ice-3.5.1\include\iceutil\exception.h(20): note: see declaration of 'IceUtil::Exception'
1>c:\program files (x86)\zeroc\ice-3.5.1\include\ice\format.h(35): warning C4091: '__declspec(dllimport)': ignored on left of 'Ice::FormatType' when no variable is declared
This is compiled using ICE 3.5.1 and visual studio C++ 2015. From what I have read, this is a new warning in VS2015, and people suggest to just ignore it (and in this case, because it's the ICE libraries that are exporting the class, there isn't much I can do about it anyway). However, I am receiving a memory access violation exception, and I am concerned it might be related.
Comments
-
Hello Leo,
We did not support VS2015 with Ice 3.5.1:
https://doc.zeroc.com/display/Ice35/Supported+Platforms+for+Ice+3.5.1so I suggest you upgrade to a more recent version of Ice, preferably the latest, Ice 3.7.2.
The latest Ice header files suppress this warning C4275:
https://github.com/zeroc-ice/ice/blob/3.7/cpp/include/IceUtil/PushDisableWarnings.h#L15Best regards,
Bernard0 -
Thanks. I had attempted to use 3.6 and 3.7 but there are so many APIs that seem to have been removed that it would be a huge undertaking for me to upgrade the application. eg. BasicStream.h, Outgoing.h, Direct.h, StreamF.h, not to mention the many APIs with files that still exist. And the upgrade page doesn't seem to make mention of these: https://doc.zeroc.com/ice/3.6/ice-release-notes/upgrading-your-application-from-ice-3-5#id-.UpgradingyourApplicationfromIce3.5v3.6-ChangedAPIs
0 -
Hi,
Your code isn't supposed to include these headers or use internal APIs. There should be only few APIs changes and they are all documented on the upgrade page in our release notes.
If you run into issues with internal headers, it's most likely because you are trying to compile code generated from Slice files with the
slice2cpp
3.5 compiler. You need to re-compile the Slice files with theslice2cpp
compiler from Ice 3.6 or 3.7 to make sure that the generated code only references headers from 3.6 or 3.7.Cheers,
Benoit0 -
BTW, the issue I am facing ATM is that I have a method that is passed parameters. After the following call to the ICE library:
::IceInternal::Outgoing __og(__handler.get(), __Epx__V3__ParameterService__getKeys_name, ::Ice::Normal, __context, __observer);The stack seems to be corrupted as the passed in paramters become NULL.
0 -
Hi,
It's difficult to say what could be the cause without additional information. Did you recompile the Ice runtime with VS2015 for instance? As Bernard mentioned, VS2015 isn't a supported compiler for Ice 3.5 so we can't really help with that if you pursue this route.
I strongly recommend to use a supported Ice version to re-compile your application instead. Upgrading from 3.5 to 3.6 or 3.7 shouldn't be difficult and we can provide assistance with the upgrade if needed (within the limits of the free support we can provide on the these forums).
Cheers,
Benoit0