• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
sarim

error LNK2019

7 posts in this topic

Hey guys, i began work on an engine today using DirectX 10 but i ran into some sort of linking problem. I'm trying to initialize DX10 in my demo program using my engine so far and it keeps coming up with this error:

[CODE]
Error 1 error LNK2019: unresolved external symbol _D3D10CreateDeviceAndSwapChain@32 referenced in function "public: bool __thiscall dm::Graphics::Init_D3D(class dm::System *)" (?Init_D3D@Graphics@dm@@QAE_NPAVSystem@2@@Z) C:\Users\Sarim\Documents\Visual Studio 2010\Projects\DX10Game\DX10Game\DarkMatter.lib(DM_Graphics.obj)
[/CODE]

I linked everything right in the "Additional Dependencies" and included "d3dx10d.lib" and "d3d10.lib" in both my engine project and my demoing program. My engine was working fine and i could use it all up until the point where i added the code to initialize Direct3D. Any help? And ill post code as needed if someone requests it.
0

Share this post


Link to post
Share on other sites
Just because you didn't get a reply in 1 hour and 16 minutes doesn't mean you need to [url="http://www.gamedev.net/topic/626971-error-lnk2019/"]cross post[/url].

Your linker is complaining that it can't find the definition of D3D10CreateDeviceAndSwapChain ([url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb205087(v=vs.85).aspx"]this function requires you to link to D3D10.lib[/url]). The fact that it can't find this definition says that you are not, contrary to what you might think, properly linking to D3D10.lib.

I'm going to take a wild shot in the dark and guess (without more info): you haven't linked to it (i.e. you linked to it in Release but not Debug mode), or you're doing something like improperly mixing x86 and x64 libraries, or your library search paths are messed up so it can't find the library. It could be any of these, or it could be something else, but I can't say for sure without knowing more.
1

Share this post


Link to post
Share on other sites
In my "Additional Dependencies" in VS 2010 i have the following:

"d3dx10d.lib"
"d3d10.lib"
"DarkMatter.lib" (My engine)

My project is in Debug mode so i linked it to that too. And i don't know how i can mix x86 and x64 libraries when i checked my project properties carefully and made sure that everything is linked to the x64 library of DX10.
0

Share this post


Link to post
Share on other sites
[quote name='KrNaGe' timestamp='1340662443' post='4952813']
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]I linked everything right in the "Additional Dependencies" and included "d3dx10d.lib" and "d3d10.lib" in both my engine project and my demoing program. My engine was working fine and i could use it all up until the point where i added the code to initialize Direct3D. Any help? And ill post code as needed if someone requests it.[/background][/size][/font][/color][/quote]
You will need to make sure the library location is in the "Additional Library Directories" path as well.
0

Share this post


Link to post
Share on other sites
I put the library location in "Library Directories" In the VC++ tab already.
0

Share this post


Link to post
Share on other sites
[quote name='KrNaGe' timestamp='1340669400' post='4952840']
And i don't know how i can mix x86 and x64 libraries when i checked my project properties carefully and made sure that everything is linked to the x64 library of DX10.
[/quote]
Look carefully at the linker error: [font=courier new,courier,monospace]unresolved external symbol _D3D10CreateDeviceAndSwapChain@32[/font]. See that 32 at the end there? It's telling you it's looking for the function and it needs to be a 32 bit function. You're linking to the 64 bit libs. You need to link to the 32 bit libs. I'm going to take a wild guess that you have a 64 bit operating system but are making a 32 bit program. Either way though, it wants you to link to the 32 bit (x86) libs.
2

Share this post


Link to post
Share on other sites
ok so i've come to the conclusion that it's my Engine Project that is causing the problem because when i build it, i get some warnings concerning D3D10.lib.

[CODE]
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\Users\Sarim\Documents\Visual Studio 2010\Projects\DarkMatter\DarkMatter\.\Lib\DarkMatter.lib) does not match the Library's OutputFile property value (C:\Users\Sarim\Documents\Visual Studio 2010\Projects\DarkMatter\DarkMatter\DarkMatter.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
1>d3d10.lib(d3d10.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in d3dx10d.lib(d3dx10d_43.dll); second definition ignored
1>d3d10.lib(d3d10.dll) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1> DarkMatter.vcxproj -> C:\Users\Sarim\Documents\Visual Studio 2010\Projects\DarkMatter\DarkMatter\.\Lib\DarkMatter.lib
[/CODE]

On MSDN it says "To prevent this error, do not link a .obj with no public symbols into a library"...and i have no idea what that means. Does anyone know how to fix this warning? I think it's the main reason why i can't use it in my demo program.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0