opengl getUniformLocation

Im having trouble with getting a proper location of my uniform in my opengl shaders. I always but always get -1 returned from the glGetUniformLocation Function.

maybe I didnt load it well?

I read online that uniforms can get optimized out for not-using them, but I do use my uniforms in a way that can affect my shaders(or do I,I think I do).
also, everytime I encounter an answer that is related to this problem on stackoverflow or on some other site,they do talk about this fact, but NO ONE EXPLAINS about an alternative solution for this, and that realy got me struggling. is it something new just for new opengl iterations?

here is my vertex shader code:

#version 410 core

in vec4 position;
uniform mat4 mvmatrix;
uniform mat4 projmatrix;

void main(void)
{
gl_Position = projmatrix * mvmatrix * position;
}

here is my fragment shader code:

#version 410 core

out vec4 color;

void main(void)
{
color = vec4(1.0,1.0,1.0,1.0)
}

and here is the whole source code for the whole program..for now I didnt implement the whole code itself,only the part that compliles the program and shaders, but yet, Im struggling to get the location for the uniforms, Ive been struggling with this for several days...hoping someone could save me here: