-
In both I got the same to linking errors:
wow error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function "int __cdecl Game_Init(void *)" (?Game_Init@@YAHPAX@Z)
wow fatal error LNK1120: 1 unresolved externals
wow is the name of project
-
What libraries are you including with your project?
I havent done DX in a while and I dont even know how to configure project settings in VC++.NET, but it sounds like you're just missing a few libs.
-
The ones that MVC++ .NET automatically puts in and the lib folder of DirectX 8.1 Do I need to do that #pragma thing? If so how?
-
In VC++6.0 under Project -> Project Settings -> Link -> Object/library options, I am using the following libs:
dsound.lib dinput8.lib dxerr8.lib d3dx8dt.lib d3d8.lib d3dxof.lib dxguid.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
That's a project I dug up from a while ago and I cant remember which ones you need or dont, but putting them all in will probably let it compile, you'll want to cut out the unneccessary ones when you know what you need though. Some of them might be different for dx8.1, that example is dx8.0
I've got VC++.NET but I cant find the project settings, I'm sure a quick look in help will tell you where they are.
Hope this helps
-
I do too. I'll tell you if it doesn't
-
I found out how to get the project properties (right click on the project in the solution explorer), but I can't do anything from there.
-
Cha Ching, I got it, yay, I'm the best, yay! :D :D :D Now my book will work. No more looking for tutorials for me!
[edit]
10 minutes later:
dope!! I tried the book code and it can't open ddraw.h!! AND I HAVE THE FOLDER WITH IT IN IT INCLUDED
-
I don't think it's in project properties. I'm sure this isnt the best way to do it but I converted my old DX project to .NET format and searched for any mention of the libs. The libs to be included are stored in wow.vcproj. If you open it in a text editor like notepad (while the project is closed in VS), you'll be able to see the project settings, here's mine:
You'll see the libraries mentioned twice, once for debug and once for release, under AdditionalDependencies= (the two long lines here), try and copy the relevant pieces into your project file, save, close and open in VS.
Code:
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="DX"
ProjectGUID="{49845AF9-DE1C-407D-B96F-F097A95CF311}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,_WIN32_DCOM"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/DX.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="dsound.lib dinput8.lib dxerr8.lib d3dx8dt.lib d3d8.lib d3dxof.lib dxguid.lib winmm.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/DX.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/DX.pdb"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/DX.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,_WIN32_DCOM"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/DX.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="dsound.lib dinput8.lib dxerr8.lib d3dx8dt.lib d3d8.lib d3dxof.lib dxguid.lib winmm.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/DX.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/DX.pdb"
SubSystem="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/DX.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\DX.cpp">
</File>
<File
RelativePath=".\DX.rc">
</File>
<File
RelativePath=".\d3dapp.cpp">
</File>
<File
RelativePath=".\d3dfile.cpp">
</File>
<File
RelativePath=".\d3dfont.cpp">
</File>
<File
RelativePath=".\d3dutil.cpp">
</File>
<File
RelativePath=".\diutil.cpp">
</File>
<File
RelativePath=".\dmutil.cpp">
</File>
<File
RelativePath=".\dsutil.cpp">
</File>
<File
RelativePath=".\dxutil.cpp">
</File>
<File
RelativePath=".\netconnect.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\DX.h">
</File>
<File
RelativePath=".\d3dapp.h">
</File>
<File
RelativePath=".\d3dfile.h">
</File>
<File
RelativePath=".\d3dfont.h">
</File>
<File
RelativePath=".\d3dres.h">
</File>
<File
RelativePath=".\d3dutil.h">
</File>
<File
RelativePath=".\diutil.h">
</File>
<File
RelativePath=".\dmutil.h">
</File>
<File
RelativePath=".\dsutil.h">
</File>
<File
RelativePath=".\dxutil.h">
</File>
<File
RelativePath=".\netconnect.h">
</File>
<File
RelativePath=".\netconnectres.h">
</File>
<File
RelativePath=".\resource.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath=".\DirectX.ico">
</File>
<File
RelativePath=".\bounce.wav">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
-
Oops missed your last post :rolleyes:, how did you manage to add the libs? Was that the problem?
What's the exact error it reports for DDraw.h?
-
That's nice, but it's only on that one program where ddraw.h isn't working, I only tried 2 (the ones that maes posted), you have to change some of the stuff on that for it to work. Anyways I got the libraries linked. It's SIMPLE. Right Click on properties of your project from the solution explorer. Then go to linker and choose input. In addtional dependecies, put in the .lib files you want.
-
Thanks for letting me know how to use those linker options, must have missed that. For DDraw.h are you using:
#include "ddraw.h"
OR
#include <ddraw.h>
You should be using the latter, I've never seen this written down but from experience I think "" looks inside the current project and <> looks inside the include directories you set.
-
Yes, I am using the <>, anyways, it can find it, just not open it. I'm going to try rebooting.
[EDIT]
Didn't work. Does anyone have an idea about how to fix this or what may be happening?
[/EDIT]
[EDIT]
Never mind, I did something really stupid. Instead of linking to ddraw.lib I linked to ddraw.h :rolleyes:
[/EDIT]
-
So everything works now?
Happy codeing;)
-
Yup, it works.:D
Anways, this forum is now for people who have questions about DirectX