linking problems

Pages: 12
"the specified procedure could not be found"
I got that error when i was calling D3D10CreateDeviceAndSwapChain function and I read when i ggogled that problem that problem is with linking .lib (i got it with GetLAstError() on runtime)
i linked 3 libraries

1
2
3
#pragma comment(lib, "d3d10.lib")
#pragma comment(lib, "d3dx10.lib")
#pragma comment(lib, "dxgi.lib") 


also i used these 2 headers

1
2
#include <d3d10.h>
#include <d3dx10.h> 


I installed DXSDK and still i can't call that function
can some1 tell me what I've got to do to solve my problem?
Last edited on
Always check the documentation in MSDN Online because the needed library and the needed header are always there.

In this case, http://msdn.microsoft.com/en-us/library/windows/desktop/bb205087(v=vs.85).aspx says the header file is D3D10Misc.h, which you don't seem to have included.

I know nothing about DirectX, but hopefully this is enough to solve your issue.
i think its alr included in <d3d10.h>
but i'll check it out now

EDIT: yep, it didn't help
for me it seems like problem including that dll file
perhaps compiler failed to link it to the program
Last edited on
Make sure you have the path to the .lib files setup in your IDE, it may just be it can't find lib files at the moment.
If you get the error at runtime then there is no way that a missing library could be the issue, the linker will complain.

Use Depedency Walker to see what depedencies you have. By any chance are you trying to run this in windows xp ? (directX 10 are not supported).
@mooce I tried adding libraries in solution properties, and it didn't help

@modoran I'm not running on XP, I'm running on VISTA, i'll try now dependency walker
this is from dependency walker
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

file that is not linked:
IESHIMS.DLL
message next to that file in dependency walker:
"Error opening file. The system cannot find the file specified (2)"

here is screenshot:
http://i.imgur.com/Xiwmk.jpg
Ieshims.dll and wer.dll are only used on Vista and above machines for IE8. They can, however, be downloaded here:

http://www.dll-files.com/pop.php?dll=wer

http://www.dll-files.com/pop.php?dll=ieshims


Please note that I do not think this is the cause of your problem (every program compiled with VS 2010 for example shows that warning in depedency walker).
then what could else cause
"the specified procedure could not be found"
message from GetLastError() function

i'll try dl those things
So is this a compiler, linker or runtime problem? I see GetLastError() mentioned. Runtime then?
yes
i tried running .exe file provided by tutorial
and i get same error
modoran wrote:
If you get the error at runtime then there is no way that a missing library could be the issue, the linker will complain.
The #pragma comment(lib, "XXX") pre-processor command is a run-time link, so the error will not appear when the user compiles the application. I hate that MSDN encourages this behavior, but it is a simple way of telling the user what to link to, and in what order.

@OP: If you have downloaded the .exe and you are still getting that error then the answer is obvious, you don't have the required file, or you don't have the required version of the file. Run Windows updates if you have to and\or download the latest Windows SDK and set the search path to point to it. Then let us know if this worked.
Last edited on
The #pragma comment(lib, "XXX") pre-processor command is a run-time link, so the error will not appear when the user compiles the application. I hate that MSDN encourages this behavior, but it is a simple way of telling the user what to link to, and in what order.


If "XXX" library is not found then you will get a fatal error from the linker and the program will not build, it is the same behavior as adding the library under project properties IDE settings.

Where do you hear this ? It is incorrect.
The #pragma comment(lib, "XXX") pre-processor command is a run-time link, so the error will not appear when the user compiles the application
From MSDN:
lib
Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. The library name follows the default library-search records in the object file; the linker searches for this library just as if you had named it on the command line provided that the library is not specified with /nodefaultlib. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.

Maybe I gave the impression that I meant you could link to libraries at run-time but I meant the DLL. I think the OP has the right lib file but either doesn't have the right DLL or they have the wrong version of the required DLL. This would explain why they can compile just fine (because he isn't statically linking, the lib they are using is inserting an address to check in the DLL at run-time) but when he goes to execute it, it throws an error.

EDIT: I could be wrong, I don't use MSVS but the other alternative is that whatever tutorial the OP is using is linking to run-time link version of the libraries. In which case my theory that they are missing or have the wrong DLL files is still correct.
Last edited on
I installed windows SDK
error is still up
but now when i compile my code, in debug notes stands this:
First-chance exception at 0x768afc56 in direct x10.exe: Microsoft C++ exception: _com_error at memory location 0x003beae8..
First-chance exception at 0x768afc56 in direct x10.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Read this for how to catch the exception and see why it is failing:
http://msdn.microsoft.com/en-us/library/0ye3k36s
this is getting annoying...
anyway i got error message from _com_error (guess what):
unknown error 0x887A004


this is hilarious, 4 days passed and i still got error
i am beginner programmer but i never had fatal error for a quite long period
is this normal in programmers life?

even google doesn't say anything about this error
i have a bad feeling about this
Last edited on
If you're a beginner, I believe it's best to stay away from toolkits.

If you're stubborn and really want to use a toolkit, then you have to expect there to be errors. I have rejected multiple toolkits simply because they were not easy to use. I'm still only use the standard library and the boost libraries since I keep having issues with toolkits originally designed for POSIX systems.
@volatile i never give up

I tried reinstalling DXSDK: didn't help
I tried to create swapchain and device separated and i got linking errors in while compiling (application didn't run)

I switched back to old code, and now I got these errors while compiling (application doesn't run)

D3DClass.obj : error LNK2019: unresolved external symbol _D3DXMatrixOrthoLH@20 referenced in function "public: bool __thiscall D3DClass::Initialize(int,int,bool,struct HWND__ *,bool,float,float)" (?Initialize@D3DClass@@QAE_NHH_NPAUHWND__@@0MM@Z)
D3DClass.obj : error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 referenced in function "public: bool __thiscall D3DClass::Initialize(int,int,bool,struct HWND__ *,bool,float,float)" (?Initialize@D3DClass@@QAE_NHH_NPAUHWND__@@0MM@Z)
D3DClass.obj : error LNK2019: unresolved external symbol _D3D10CreateDeviceAndSwapChain@32 referenced in function "public: bool __thiscall D3DClass::Initialize(int,int,bool,struct HWND__ *,bool,float,float)" (?Initialize@D3DClass@@QAE_NHH_NPAUHWND__@@0MM@Z)
D3DClass.obj : error LNK2019: unresolved external symbol _CreateDXGIFactory@8 referenced in function "public: bool __thiscall D3DClass::Initialize(int,int,bool,struct HWND__ *,bool,float,float)" (?Initialize@D3DClass@@QAE_NHH_NPAUHWND__@@0MM@Z)
Pages: 12