Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) shared_ptr.hpp: call to undefined function 'assert'

 

Compile error.

 

 

 

 

 

Cause

 

IDE: C++ Builder 6.0

Compiler: Borland BCC32.EXE version 6.0.10.157

Boost version: 1.35.0.

 

I don't know why, but I've got this error in the following section of code, in the second line.

 

//shared_ptr.hpp

T * operator-> () const // never throws
{
  BOOST_ASSERT(px != 0);
  return px;
}

 

I still do not understand why it occurs (as on top of the header file boost/assert.hpp is #included).

 

This error started to occur when I split a multi-unit project over multiple folders, in which I had defined by own assert.h (instead of Assert.hpp) and use assert (instead of Assert).

 

 

 

 

 

Solution

 

Move the 'Auto-Create Forms' to 'Available' (Choose 'Project | Options | Forms').

Now compiling should be successful.

Move the 'Available' Forms back

 

Why this works? I don't know.

 

 

 

 

 

Alternative possible solution

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict