DirectX

This is a discussion on DirectX within the Game Programming forums, part of the General Programming Boards category; In both I got the same to linking errors: wow error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function "int ...

  1. #16
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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

  2. #17
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    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.
    Last edited by Robert602; 05-19-2002 at 04:09 PM.

  3. #18
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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?
    Last edited by Driveway; 05-19-2002 at 04:12 PM.

  4. #19
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    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

  5. #20
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    I do too. I'll tell you if it doesn't

  6. #21
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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.

  7. #22
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469

    Thumbs up

    Cha Ching, I got it, yay, I'm the best, yay! 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
    Last edited by Driveway; 05-19-2002 at 04:35 PM.

  8. #23
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    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>

  9. #24
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Oops missed your last post , how did you manage to add the libs? Was that the problem?

    What's the exact error it reports for DDraw.h?

  10. #25
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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.

  11. #26
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    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.

  12. #27
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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
    [/EDIT]
    Last edited by Driveway; 05-19-2002 at 06:21 PM.

  13. #28
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    So everything works now?

    Happy codeing

  14. #29
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    Yup, it works.

    Anways, this forum is now for people who have questions about DirectX
    Last edited by Driveway; 05-20-2002 at 03:55 PM.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  2. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 06:16 PM
  3. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-24-2004, 11:49 PM
  4. DirectX 8 with Borland
    By Tommaso in forum Game Programming
    Replies: 11
    Last Post: 08-12-2003, 09:30 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21