I have the following uniform block:

Code :
uniform BlobSettings {
  vec4 InnerColor;
  vec4 OuterColor;
  float RadiusInner;
  float RadiusOuter;
};

I can query how many of these I have and their name and get the correct answer:

Code :
for(int i=0; i < activeUniformsCount; i ++ {
  GetActiveUniform(shaderProgramID, i, maxLength, out written, out size, out type, name );
  int location = Program.GetUniformLocation(shaderProgramID, name);
}

I get the value in name of:
BlobSettings.InnerColor
BlobSettings.OuterColor
BlobSettings.RadiusInner
BlobSettings.RadiusOuter

I even get the right type out.

However, the value of location is always -1.

I am also asking because I get similar results for GetUniformIndices (all indicies are -1).

I have to be doing something wrong! What is it?

Note that the code is out of the book Getting Started With GLSL 4.0 (pg 38-40).