Error LNK2001: unresolved external symbol _D3DXCreateFont@48

Posts 1–15 of 28 · Page 1 of 2
Error LNK2001: unresolved external symbol _D3DXCreateFont@48
[HTML]1>------ Build started: Project: MenuHack, Configuration: Release Win32 ------
1>Compiling...
1>Linking...
1>Base.obj : error LNK2001: unresolved external symbol _D3DXCreateFont@48
1>C:\Documents and Settings\***\Desktop\CaBase\Release\CaBase.dll : fatal error LNK1120: 1 unresolved externals
==========
Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
=========/HTML]

I searched on MPGH and Google. These are my Includes:

[HTML]#include <windows.h>
#include <Winuser.h>
#include <stdio.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <fstream>
#include <stdio.h>[/HTML]

I tried 3 different bases all day and all of them gave me this error!
where are you creating the font?
You didn't link d3dx9.lib.
Yes I did

[html]#pragma comment(lib, "d3dx9.lib")[/html]

and the font is in the RenderFrame
[html]
if( !Base.bSet.bInit )
{
D3DXCreateFont(pDevice, 15, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Directx.pFont);
Base.bSet.bInit = true;
}

if( Directx.pFont == NULL )
Directx.pFont->OnLostDevice();
else
{
Directx.DrawString(10, 22, D3DCOLOR_ARGB(255, 255, 0, 0), Directx.pFont, "<<-Public Menu Dimensions->>");
Menu.RenderMenu();
}[/html]

Edit: This is happening to everything, not just 1 menu.

"I tried 3 different bases all day and all of them gave me this error! "
Well then it's not finding it. Did you add the libraries directory in your project options?
No, I never got this ever, this is just random....

Where and what do I have to add to the libraries directory?

Edit:: What do I have to, not where, I all ready know.

Translated: I all ready know where I can add library Directories, just what is the directory I have to add?
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

#include "D3dx9core.h"
#pragma comment(lib, "d3dx9.lib")

Edit: it looks like you've added your includes, but not your library files. Go to Tools->Options-> Projects and Solutions-> vC++ Directories -> Library Files-> New Path

Then browse through and find your directx sdk lib folder and choose x86 orr x64 based on your Operating system architecture.
Quote Originally Posted by Revolvium View Post
D3DXCreateFont Function (Windows)

#include "D3dx9core.h"
#pragma comment(lib, "d3dx9.lib"

Edit: it looks like you've added your includes, but not your library files. Go to Tools->Options-> Projects and Solutions-> vC++ Directories -> Library Files-> New Path

Then browse through and find your directx sdk lib folder and choose x86 orr x64 based on your Operating system architecture.
I feel like moving everything from C:\Program Files\Microsoft DirectX SDK (June 2010)\Include to my project.

and by the way....

[html]#include "D3dx9core.h"
#pragma comment(lib, "d3dx9.lib"[/html]

Must have been typed incorrectly.
Quote Originally Posted by -Dimensions- View Post
I feel like moving everything from C:\Program Files\Microsoft DirectX SDK (June 2010)\Include to my project.

and by the way....

[html]#include "D3dx9core.h"
#pragma comment(lib, "d3dx9.lib"[/html]

Must have been typed incorrectly.

Oopies, forgot the bracket at the end on there. Fixed now.
Still, not working. I tried probably every way.
Quote Originally Posted by -Dimensions- View Post
Still, not working. I tried probably every way.
What bases have you tried it in, because i got a similar error in Hybrid, bu tin my own I didn't, i was drawing sprites for both.
Have you tried manually adding the libraries to the project like Void mentioned?
Yes, I have, and I tried TopBase. It worked 3 times, then I got Error LNK2001: unresolved external symbol _D3DXCreateFont@48 . The only thing I changed was text. So I re-extracted TopBase and I tried again and still Error LNK2001: unresolved external symbol _D3DXCreateFont@48 . I am going to re-install my DirectX SDK and Visual Studio C++ . I'll let everyone know if that worked.
you ethier did not link the lib
did not add its source and lib
or added more than one of its sources/libs

btw i fixed by only linking the x86 lib of the sdk
Google is full of answers...
Posts 1–15 of 28 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?