• 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
Mattaria

VS2010/DirectX linkage errors

14 posts in this topic

Hi all, I've been having a problem with a game I created for a University project recently using C++ and DirectX 9. The game runs fine in debug, however when I try to run it in release, it has around 30 LINK2001 errors.

I have set up the directory in the project's properties and i've checked to make sure they match in both debug and release.

Can anyone help me?

Cheers, Matt
0

Share this post


Link to post
Share on other sites
Post your link errors, you may have missed a additional library include directory on your release build.
Or including the .lib with your linker settings for release mode.
0

Share this post


Link to post
Share on other sites
Using all the information you have given, the only possible help to give you is this link:

[url="http://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx"]MSDN: Linker Tools Error LNK2001[/url].

But since you insist, let's play the GameDev.net hint pleaing game..

Can you list which symbols you are missing?

Do you know which library files they are supposed to be located in?

Have you checked you are not missing an important library?

Which library files are you linking to in release? Which ones are you linking to in debug mode?

Which header files did you include to reference the missing symbols?

If you built the libraries yourself, are you sure you matched the signatures when building and referencing the library (C/C++ preprocessor settings match)?




0

Share this post


Link to post
Share on other sites
Hey thanks for the fast response. I should clarify that I am not really 100% sure on this kind of stuff. We have only been taught how to write code :P

Here are the errors:

Error 6 error LNK2001: unresolved external symbol _IID_IDirectInput8A C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 -Prog For Games\DirectInput.obj Building 9 - Project 1
Error 1 error LNK2001: unresolved external symbol _GUID_SysMouse C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 3 error LNK2001: unresolved external symbol _GUID_SysKeyboard C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 24 error LNK2001: unresolved external symbol _DXGetErrorStringA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 25 error LNK2001: unresolved external symbol _DXGetErrorDescriptionA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 4 error LNK2001: unresolved external symbol _DirectInput8Create@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 14 error LNK2001: unresolved external symbol _Direct3DCreate9@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 9 error LNK2001: unresolved external symbol _D3DXMatrixTranslation@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 20 error LNK2001: unresolved external symbol _D3DXMatrixScaling@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 18 error LNK2001: unresolved external symbol _D3DXMatrixRotationZ@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 16 error LNK2001: unresolved external symbol _D3DXMatrixRotationY@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 19 error LNK2001: unresolved external symbol _D3DXMatrixRotationX@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 11 error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveLH@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 15 error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 13 error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 7 error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 27 error LNK2001: unresolved external symbol _D3DXLoadMeshHierarchyFromXA@28 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 22 error LNK2001: unresolved external symbol _D3DXLoadMeshFromXA@32 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 21 error LNK2001: unresolved external symbol _D3DXGetFVFVertexSize@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 26 error LNK2001: unresolved external symbol _D3DXFrameFind@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 28 error LNK2001: unresolved external symbol _D3DXFrameDestroy@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 29 error LNK2001: unresolved external symbol _D3DXFrameCalculateBoundingSphere@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\XfileEntity.obj Building 9 - Project 1
Error 8 error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 12 error LNK2001: unresolved external symbol _D3DXCreateSprite@8 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1
Error 23 error LNK2001: unresolved external symbol _D3DXCreateFontA@48 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\UI.obj Building 9 - Project 1
Error 17 error LNK2001: unresolved external symbol _D3DXComputeBoundingBox@20 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Mesh.obj Building 9 - Project 1
Error 5 error LNK2001: unresolved external symbol _c_dfDIMouse2 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 2 error LNK2001: unresolved external symbol _c_dfDIKeyboard C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\DirectInput.obj Building 9 - Project 1
Error 10 error LNK2001: unresolved external symbol __imp__timeGetTime@0 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Direct3D.obj Building 9 - Project 1


I don't really know anything about libraries, so sorry for being a bit useless with information.

What specific things should I be looking at in the config?
0

Share this post


Link to post
Share on other sites
You probably not linking the DirectX9 libraries.
This will fix it :
[source]
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib") // if i remember correct
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dxguid.lib")
[/source]

Edit : i was still editing my post, but clb found the libs before me : ) Edited by Jeffreyp
1

Share this post


Link to post
Share on other sites
For the bulk of D3DX functions, remember to link against d3dx9.lib. Note that in debug mode, you will link against d3dx9d.lib instead. (Don't link to d3dx9d.lib in release, and vice versa)

I remember DXGetErrorString are in DxErr.lib, or DxErr9.lib. Those GUID identifiers are in dxguid.lib.

Double check that you are linking against those libraries in release, in addition to just linking to d3d9.lib.

0

Share this post


Link to post
Share on other sites
timeGetTime is in winmm.lib. Just google the name of the function, you'll find the appropriate msdn page which says which lib to link against: http://msdn.microsoft.com/en-us/library/dd757629(VS.85).aspx.

Also, you seem to have some DirectInput stuff from dinput8.lib.

0

Share this post


Link to post
Share on other sites
Ok. Thank you very much for the help! That has fixed most of it. Is there a way to do it without having to include the libraries in each header file which uses it?

Also I have 2 errors left. I pressume these are from a library which is in a different folder. How do i go about linking this? Sorry for the questions, I am a complete beginner in terms of this sort of stuff.
0

Share this post


Link to post
Share on other sites
Ahhhh Ok thanks.

Errors:

Error 1 error LNK2001: unresolved external symbol _DXGetErrorStringA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1
Error 2 error LNK2001: unresolved external symbol _DXGetErrorDescriptionA@4 C:\Users\Matt\Desktop\Building 9\Eddie\Group 3 - Prog For Games\Utility.obj Building 9 - Project 1

I have a library file in a seperate folder which I think is causing the problem, it's a custom library we were using as a temp for animation before we learn how to do it ourselves.
0

Share this post


Link to post
Share on other sites
Mmm you need the DxError lib(what CLB said),
so it is
[source]
pragma comment(lib, "DxErr9.lib")
[/source]
or
[source]
pragma comment(lib, "DxErr.lib")
[/source]
or both :P

I cant say it for sure because i never used it.

Hope it will fix the remaining errors : )
0

Share this post


Link to post
Share on other sites
Hey Jeffrey, I tried adding:

[code]#pragma comment(lib, "DxErr9.lib")[/code]

This gives a popup during compilation saying:

"Debugging information for 'Building 9 - Project 1.exe' cannot be found or does not match...

...do you want to continue debugging?"

Choosing yes, starts the game.

I have a folder for XAnimator, the stuff we are using for animation, which contains it's own custom library. Is it the linking of the stuff here causing the problem?
0

Share this post


Link to post
Share on other sites
I think [url="http://stackoverflow.com/questions/2322876/debugging-information-cannot-be-found-or-does-not-match-visual-studios"]this[/url] can help you out.
0

Share this post


Link to post
Share on other sites
It sounds to me as though you may have set up the original imports for d3d9.lib and d3dx9.lib under project properties/linker/additional library dependencies for your debug config, but not done so for your release config. Double-checking that and fixing it if appropriate will be a cleaner solution than manually specifying them via #'pragma directives.
0

Share this post


Link to post
Share on other sites
WOOO! Thanks to all you lovely people, our game now runs in release mode!

Mhagain, I have set up the libraries like you have said already, but that didn't work and I don't know why, so looks like it's staying with the #pragmas for now.

As an attempt for me to learn a bit more about the compiler options and whatnot, here are some things which are the same in debug and release. should they be?
[list][*]All of the VC++ options[*] Linker > Additional library directories[/list]in the C/C++ option list, under output files the following are different:
[list][*]ASM list location --> Debug: .\debug/ --> Release: $(IntDir)[*]object file name --> Debug: .\debug/ --> Release:$(IntDir)[*]Program database file name --> Debug: .\debug/ --> Release:$(IntDir)vc$(PlatformToolsetVersion).pdb[/list]Would just like to thank everyone who contributed and spent their time trying to help a novice like myself :)
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