[Unsloved] (Directx Related) unresolved external symbol _main
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: [Unsloved] (Directx Related) unresolved external symbol _main

  1. #1
    Join Date
    May 2009
    Posts
    3

    Resolved [Sloved] (Directx Related) unresolved external symbol _main

    Code:
    -------------------Configuration: d3dxconsoletest - Win32 Debug--------------------
    Compiling...
    scr.cpp
    Linking...
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/d3dxconsoletest.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    
    d3dxconsoletest.exe - 2 error(s), 0 warning(s)
    I'm completely new to directx and tried this tutorial:
    http://www.directxtutorial.com/Tutor...ics/dx9B1.aspx
    (you can see the hole code at the end, i didn't posted it because it takes a lot of space)

    I made a console application and i have the march 2009 directx SDK.

    Please help me resolve this issue.
    Last edited by Darkov; May 26th, 2009 at 05:55 PM. Reason: because its sloved now

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: [Unsloved] (Directx Related) unresolved external symbol _main

    Do you have a main() function?

  3. #3
    Join Date
    May 2009
    Posts
    3

    Re: [Unsloved] (Directx Related) unresolved external symbol _main

    Quote Originally Posted by Lindley View Post
    Do you have a main() function?
    No.
    In the tutorial there was no main function.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: [Unsloved] (Directx Related) unresolved external symbol _main

    Well, then something's wrong with the tutorial. I mean, where do you *expect* control to begin when you launch the app?

    EDIT: It appears the tutorial is using WinMain() as the entry point. You'll need to change your project type from Console Application to Windows Application if you want to use that entry point. I'm not sure if that actually makes a difference as far as ability to use D3D, though.
    Last edited by Lindley; May 26th, 2009 at 02:03 PM.

  5. #5
    Join Date
    May 2009
    Posts
    3

    Re: [Unsloved] (Directx Related) unresolved external symbol _main

    Thank you i made it

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center