• Create Account

### #ActualSolid_Spy

Posted 11 February 2013 - 08:15 PM

Hello, I've been trying to get an effect file to load in my directx game, however, i seem to get some strange errors. I followed the tutorial from a book I got, but it doesn't seem to work. It appears that I get the error every time i reach the CreateShaderFromMemory() function. Here's the code for my .cpp:

void InitPipeline()
{

ID3D10Blob *errorMessage = 0;

HRESULT hr;

if(FAILED(hr))
{
MessageBox(0, "shader compiler error", "ERROR", MB_OK);
}

errorMessage->Release();



And here is my shader file:

struct vertexIn
{
float3 position : POSITION;
float4 color    : COLOR;
};

struct vertexOut
{
float4 position : SV_POSITION;
float4 color    : COLOR;
};

vertexOut VS(vertexIn vIn)
{
vertexOut vOut;
vOut.position = float4 (vIn.position, 1.0f);
vOut.color = vIn.color;

return vOut;
}

float4 PS(vertexOut pixelinsert) : SV_Target
{
return pixelinsert.color;
}

technique11 t0
{
pass p0
{
}
}


Here are the errors I am getting:

Error    3    error LNK1120: 2 unresolved externals    C:\..Project30.exe    1    1    Project30

Any help would be appreciated

### #2Solid_Spy

Posted 11 February 2013 - 08:14 PM

Hello, I've been trying to get an effect file to load in my directx game, however, i seem to get some strange errors. I followed the tutorial from a book I got, but it doesn't seem to work. It appears that I get the error every time i reach the CreateShaderFromMemory() function. Here's the code for my .cpp:

void InitPipeline()
{

ID3D10Blob *errorMessage = 0;

HRESULT hr;

if(FAILED(hr))
{
MessageBox(0, "shader compiler error", "ERROR", MB_OK);
}

errorMessage->Release();



And here is my shader file:

struct vertexIn
{
float3 position : POSITION;
float4 color    : COLOR;
};

struct vertexOut
{
float4 position : SV_POSITION;
float4 color    : COLOR;
};

vertexOut VS(vertexIn vIn)
{
vertexOut vOut;
vOut.position = float4 (vIn.position, 1.0f);
vOut.color = vIn.color;

return vOut;
}

float4 PS(vertexOut pixelinsert) : SV_Target
{
return pixelinsert.color;
}

technique11 t0
{
pass p0
{
}
}


Here are the errors I am getting:

Error    3    error LNK1120: 2 unresolved externals    C:..Project30.exe    1    1    Project30

Any help would be appreciated

### #1Solid_Spy

Posted 11 February 2013 - 08:13 PM

Hello, I've been trying to get an effect file to load in my directx game, however, i seem to get some strange errors. I followed the tutorial from a book I got, but it doesn't seem to work. It appears that I get the error every time i reach the CreateShaderFromMemory() function. Here's the code for my .cpp:

void InitPipeline()
{

ID3D10Blob *errorMessage = 0;

HRESULT hr;

if(FAILED(hr))
{
MessageBox(0, "shader compiler error", "ERROR", MB_OK);
}

errorMessage->Release();



And here is my shader file:

struct vertexIn
{
float3 position : POSITION;
float4 color    : COLOR;
};

struct vertexOut
{
float4 position : SV_POSITION;
float4 color    : COLOR;
};

vertexOut VS(vertexIn vIn)
{
vertexOut vOut;
vOut.position = float4 (vIn.position, 1.0f);
vOut.color = vIn.color;

return vOut;
}

float4 PS(vertexOut pixelinsert) : SV_Target
{
return pixelinsert.color;
}

technique11 t0
{
pass p0
{
}
}


Here are the errors I am getting:

Error    3    error LNK1120: 2 unresolved externals    C:\Users\Connor\documents\visual studio 2012\Projects\Project30\Debug\Project30.exe    1    1    Project30