Followers 0

# DX11 Error using Effects in Directx 11.0

## 1 post in this topic

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
Edited by Solid_Spy
0

##### Share on other sites

In your project properties under Linker > Input > Additional Dependencies is d3dcompiler.lib specified in this list? If not, try adding it. I had the same issue and it's because those methods are defined in d3dcompiler.lib and I was missing it in my Linker dependencies.

0

## Create an account

Register a new account

Followers 0

• ### Similar Content

• Hi Guys,
I am just wondering if it is possible to acquire the address of the backbuffer if an API (based on DX11) only exposes the 'device' and 'context' pointers?
Any advice would be greatly appreciated

• bool InitDirect3D::Init() { if (!D3DApp::Init()) { return false; } //Additional Initialization //Disable Alt+Enter Fullscreen Toggle shortkey IDXGIFactory* factory; CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&factory)); factory->MakeWindowAssociation(mhWindow, DXGI_MWA_NO_WINDOW_CHANGES); factory->Release(); return true; }
As stated on the title and displayed on the code above, regardless of it Alt+Enter still takes effect...
I recall something from the book during the swapChain creation, where in order to create it one has to use the same factory used to create the ID3D11Device, therefore I tested and indeed using that same factory indeed it work.
How is that one particular factory related to my window and how come the MakeWindowAssociation won't take effect with a newly created factory?
Also what's even the point of being able to create this Factories if they won't work,?(except from that one associated with the ID3D11Device)
• By ProfL
Can anyone recommend a wrapper for Direct3D 11 that is similarly simple to use as SFML? I don't need all the image formats etc. BUT I want a simple way to open a window, allocate a texture, buffer, shader.

• Q1:
Since there is no more fixed pipeline rendering in DX11, for every part of rendering in DX11, do I need to create a brand-new vertex shader and pixel shader... or at least I have to find one relevant online. If you work on skinned meshes and other effects originally worked in DX9 fixed pipeline, do I have to rework everything by now?

Q2:
For assimp, if it originally was designed for DX9, like it is coupled to a DX9 device for creating meshes and materials etc. Do I have to add in the DX11 device in the assimp, or can I just leave the assimp to remain in DX9 and after the meshes are loaded, I just convert the vertex buffers and index buffers into DX11 buffers?
Thanks
Jack

• This header is mentioned in the book I'm reading but there is no documentation on msdn... Is it like an... outdated and abandoned header?
If so, what's the current default/recomended library for handling errors with directX?

• 20
• 12
• 11
• 30
• 20