-
What does this mean?
While trying DirectDraw for the first time, I got the following error:
DirectDraw error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "int __cdecl InitDirectDraw(void)" (?InitDirectDraw@@YAHXZ)
What does this mean?
-
You need to link a lib file.
-
Any idea how to do this in VC++ .Net?
Thanks
-
What DirectX version are you using? I'll assume 9, but the method would be the same (the name would be different) for old versions.
Essentially, you have 3 options:
1) Add it into the linker's libraries (under the options menu for the project).
2) Add the .lib directly to your project just like any other source file.
3) Put the following into a source (any .h or .cpp file): #pragma comment(lib,"d3d9")
I personally use #3; it's not portable to all compilers, but it's in the source code itself, which means that you only need to give someone the source for them to know what libraries they need to include.
Edit: I guess you're not using DirectX 9 (DirectDraw hasn't existed as a standalone since DirextX 7). Nonetheless, the method is the same.
-
actually I am using directx 9.
I've always wondered what #pragma comment does!
Thanks alot. =)
-
btw, how do I find out the name of the library?
I mean, the library I want to inlcude is ddraw.lib
so i would have to include:
#pragma comment(lib, "ddraw") ?
Umm I can't explain it well enough, but are is the format:
#pragma comment(file extension, "name of file")??
Thanks
-
lib tells it the type of the file, and the string is the filename (without the extention).
#pragma comment(lib, "ddraw") would tell the linker to search for a file called "ddraw.lib" on any of the default search paths.
-
Umm since we're talking about #pragmas
Whats #pragma once do? VC++ seems to auto generate it in the code alot.
Thanks Again!:D
-
Anything and everything. #pragma's are compiler dependent things that will do various things. For instance, they can be used to inhibit certain warnings, or many other things.