Giter Site home page Giter Site logo

dynamic-cpp's People

Contributors

ferruccio avatar

dynamic-cpp's Issues

Can't compile with boost library in CentOS 6.6

What steps will reproduce the problem?
1. yum install boost-devel
2. my boost version is 1.54
3. No idea how to compile with boost error below

What is the expected output? What do you see instead?
When i changed to /usr/lib64, i get the error like this:

CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:651 (file):
  file STRINGS file "/usr/lib64/boost/version.hpp" cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:38 (find_package)


CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1138 (message):
  Unable to find the requested Boost libraries.

  Boost version: 0.0.0

  Boost include path: /usr/lib64



What version of the product are you using? On what operating system?
CentOS 6.6, the latest dynamic cpp


CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1138 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following static Boost libraries:

          boost_unit_test_framework

pls help. thanks

Original issue reported on code.google.com by [email protected] on 9 Dec 2014 at 5:59

Potentially serious issue with the exception class.

The _message member variable of the exception class is a const char*. The 
constructor of the exception does the following.

  _message = message;

The problem is that exceptions are thrown. This goes the exception to go beyond 
the context of the calling function.

This will work as long as the exception is used as follows.

throw exception("some quoted string.");

It works by chance because "some quoted string." is treated as a pointer to 
some fixed place in the final executable.

However, this will cause problems.

char message[1024];
/* code to format that message */
throw exception(message);

By the time what gets called, the _message member variable no longer points to 
valid data.

This is why std::exception copies the message, and does not just use =.

Here is the implementation from Visual Studio.

_EXCEPTION_INLINE __CLR_OR_THIS_CALL exception::exception(
  const char * const & _What)
  : _Mywhat(NULL), _Mydofree(false)
{
  _Copy_str(_What);
}

_Copy_str uses malloc and strcpy.

Here is the source of _Copy_str.

// _Copy_str() assumes that *this is already tidy.
_EXCEPTION_INLINE void __CLR_OR_THIS_CALL exception::_Copy_str(
  const char * _What)
{
  if (_What != NULL)
  {
    const size_t _Buf_size = strlen(_What) + 1;
    _Mywhat = static_cast<char *>(malloc(_Buf_size));
    if (_Mywhat != NULL)
    {
      _CRT_SECURE_STRCPY(const_cast<char *>(_Mywhat), _Buf_size, _What);
      _Mydofree = true;
    }
  }
}

Original issue reported on code.google.com by [email protected] on 28 Jun 2014 at 10:35

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.