5 Replies - 717 Views - Last Post: 22 April 2013 - 03:47 AM Rate Topic: -----

#1 Magn0733  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 04-April 13

LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 21 April 2013 - 05:01 PM

Hey guys.

I've spent the entire day trying to start up on game programming in C++.
I keep getting errors, finding unusefull tutorials/info, more errors and getting nowhere :(

It really starts to bugg me up since i've spend more then 10 hours just trying to type some actual code without it gives me an error :(

Currently i am following a tutorial on Directx 11 (http://www.directxtutorial.com/Lesson.aspx?lessonid=11-1-3)

And when i try to set up the starting window i get the two errors from the title?

There are no line displayment so i don't think they are in my cpp file? Please help.

I have included all the files to the directories (include and lib) So i should be good to go right?

Please help me with this i am stressing up!

And if you have any other info on how to start game programmin in C++ PLEASE TELL ME!

ps. i am not trying to make some crazy-ass MMO - I am just trying to get a damn sprite on the screen, maybe even a 3D cube if i get so far. :)

Is This A Good Question/Topic? 0
  • +

Replies To: LNK2019, LNK1120 C++ Directx 11 HELP! :)

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 21 April 2013 - 06:43 PM

They normally have sample projects that work on those kinds of site. Download one and see how it works.
Was This Post Helpful? 0
  • +
  • -

#3 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,298
  • Joined: 22-October 08

Re: LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 22 April 2013 - 12:16 AM

Hi Magn0733,

Have you linked the require libraries?

Please paste the compiler error you are receiving so we can help you :)

I'm just like you, except I am using DirectX 9. I must say, it's been a heck of a journey so far. I've got my application launching in fullscreen, I have implemented a GUI system( CEGUI ). I have a start menu, Pause menu :) I've also created my own mesh format that will hold all the data my meshes will need. I've also got a state game state manager (STARTMENU, PAUSEMENU, GAMEPLAY). Now I am working on a world / cell system (Levels).

If you have some free time, I'd suggest http://www.two-kings.de for DirectX 9 Tutorial (I've validated that they work). Also, may I suggest this article on losts Direct3D devices: http://msdn.microsof...4(v=vs.85).aspx This will help you if you want to make your game alt+tabable (or any other action that the user will loose focus on the game window).

May I also suggest that you read up on debugging, because once you get errors and bugs, knowing debugging will significantly increase production.

Happy codings :)
Was This Post Helpful? 1
  • +
  • -

#4 Magn0733  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 04-April 13

Re: LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 22 April 2013 - 12:56 AM

View Postaaron1178, on 22 April 2013 - 12:16 AM, said:

Hi Magn0733,

Have you linked the require libraries?

Please paste the compiler error you are receiving so we can help you :)/>

I'm just like you, except I am using DirectX 9. I must say, it's been a heck of a journey so far. I've got my application launching in fullscreen, I have implemented a GUI system( CEGUI ). I have a start menu, Pause menu :)/> I've also created my own mesh format that will hold all the data my meshes will need. I've also got a state game state manager (STARTMENU, PAUSEMENU, GAMEPLAY). Now I am working on a world / cell system (Levels).

If you have some free time, I'd suggest http://www.two-kings.de for DirectX 9 Tutorial (I've validated that they work). Also, may I suggest this article on losts Direct3D devices: http://msdn.microsof...4(v=vs.85).aspx This will help you if you want to make your game alt+tabable (or any other action that the user will loose focus on the game window).

May I also suggest that you read up on debugging, because once you get errors and bugs, knowing debugging will significantly increase production.

Happy codings :)/>


Aha! Maybe i should step back and start up on directx 9 seems like that what most people do :)
I'm definetly going to check out your links - and can't wait to do so! :)

For the debugging. I can't seem to debugg this properly since it's not in my cpp file :(
Atleast i don't know how to debugg outside of my main class or other of my classes :S
The errors are:
1. error LNK2019: Unresolved external symbol _main refered in function _tmainCRTStartup (FileLocation: MSVCRCTD.lib(crtexe.obj))
2. error LNK1120: 1 unresolved externals

I have abseloutly no clue what those error do...
I havn't spend too much time in C++, normaly i programm in C# and doing fine so. But decided to step it up when i saw that XNA was shut down. :(

Hope you still can tell me what's wrong.

ps. my code is CTL-C, CTL-V from
http://www.directxtu...lessonid=11-1-3
right under: "Our first window" Paragraph.

So there should be no typos.
Was This Post Helpful? 0
  • +
  • -

#5 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,298
  • Joined: 22-October 08

Re: LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 22 April 2013 - 01:42 AM

When creating your project, did you choose a WIN32 application or Console application? It sounds to me like you chose a Console application instead of a WIN32 application because if it was a WIN32 application it would need this:

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPreviousInstance, LPSTR lpcmdline, int nCmdShow )
{

}



where as for a console application it would be something like:

int main( /*params*/ )
{

}



Just double check that by going to (In Visual Studio 2010) Project Properties -> C/C++ -> Preprocessor and make sure that _WINDOWS is defined in 'Preprocessor Definitions' not _CONSOLE.

Try this to convert from Console to WIN32 Project or see my solution bellow:

http://stackoverflow...ual-studio-2010

I'm not sure if the above link will help, so try this solution:

Instead of _CONSOLE, change it to _WINDOWS. Now go to Project Properties -> Linker -> SubSystem and change it to Windows (/SUBSYSTEM:WINDOWS)

Happy codings, let us know if it works :)
Was This Post Helpful? 2
  • +
  • -

#6 Magn0733  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 04-April 13

Re: LNK2019, LNK1120 C++ Directx 11 HELP! :)

Posted 22 April 2013 - 03:47 AM

View Postaaron1178, on 22 April 2013 - 01:42 AM, said:

When creating your project, did you choose a WIN32 application or Console application? It sounds to me like you chose a Console application instead of a WIN32 application because if it was a WIN32 application it would need this:

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPreviousInstance, LPSTR lpcmdline, int nCmdShow )
{

}



where as for a console application it would be something like:

int main( /*params*/ )
{

}



Just double check that by going to (In Visual Studio 2010) Project Properties -> C/C++ -> Preprocessor and make sure that _WINDOWS is defined in 'Preprocessor Definitions' not _CONSOLE.

Try this to convert from Console to WIN32 Project or see my solution bellow:

http://stackoverflow...ual-studio-2010

I'm not sure if the above link will help, so try this solution:

Instead of _CONSOLE, change it to _WINDOWS. Now go to Project Properties -> Linker -> SubSystem and change it to Windows (/SUBSYSTEM:WINDOWS)

Happy codings, let us know if it works :)/>


Yes! Thank you. :)

That fixed the error.
I didn't even know there was a real difference, so i just assumed that i had to use a console application when they said i should make a new application. x)

Well now i knows and i can get on with it, so thank you so much! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1