Constantly getting build errors :/

Discussion in 'Xbox (Original console)' started by HEX1GON, Sep 19, 2012.

  1. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    I've been trying to follow this tutorial
    http://www.xbdev.net/tuts/subpages/prt1/index.php

    I try to run the code and all I get is build errors.

    There's no real tutorials on how to even start the projects up correctly. I know I'm totally new to this, and I'm rather stupid, but I want to at least get empty code to run on the debug. I think from there I should be fine.

    Can anyone help me?
     
  2. root670

    root670 Robust Member

    Joined:
    Apr 4, 2010
    Messages:
    205
    Likes Received:
    17
    What errors are you getting? And are you able to compile any of the XDK samples?
     
  3. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    VS doesn't know the "StartGame()" function, which it's not declared and I have no idea how to declare the functions.

    The only sample code I can compile is the rotating triangle with the pre-compiled header. Other than that no other code will work. The triangle is the only code I have as a sample. My XDK doesn't have any others in the kit.
     
  4. root670

    root670 Robust Member

    Joined:
    Apr 4, 2010
    Messages:
    205
    Likes Received:
    17
    Ehh, just reinstall VS2003 and get XDK 5933. That's what works for me ;)
     
  5. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    I have both, I don't see how that would change anything... The sample code works so it's setup right...
     
  6. urisma

    urisma <B>Site Supporter 2012</B>

    Joined:
    Mar 5, 2011
    Messages:
    70
    Likes Received:
    1
    Erm, isn't this the problem? If you haven't written a function called StartGame anywhere then it won't be able to compile. If you're new to programming then you should probably hit up a few tutorials before moving on to xbox dev.
     
  7. gs37

    gs37 Robust Member

    Joined:
    May 22, 2012
    Messages:
    272
    Likes Received:
    3
    To my knowledge, StartGame(); is a built-in function. Similar to printf();.
    A header or library may need to be loaded, but if HeXiGON following the example perfectly and using a compatible version of VS and the xdk then idk what the problem could be. Unless Windows 7 might be messing him up... I do all my xbox1 work on an XP machine.
     
  8. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    I've been reading up on C++ books, and followed a lot of tutorials. I tried to make the function, but where do I place that code? All I want to do is just to be able to do what the tutorial is telling me. I don't plan to make anything myself yet.
    I mentioned in the OP I'm not very smart with C++ yet...

    Yes I know the problem urisma but I'm asking how can I fix it... Sure I don't know C++ yet and I'm not saying I do. I'm just wondering if someone could tell me how to declare it? I'll most likely figure it out myself anyway, I'm learning from a C++ book anyway. Thought I'd be able to get a direct answer.
     
  9. urisma

    urisma <B>Site Supporter 2012</B>

    Joined:
    Mar 5, 2011
    Messages:
    70
    Likes Received:
    1
    Wasn't trying to be condescending in my answer, sorry if I came off like that. Anyway, your main method calls StartGame, but it doesn't exist anywhere in your code. You'll have to declare a method called StartGame above your main method, like this:

    void StartGame()
    {
    }
     
  10. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    That's alright, I'm still getting the build error however.

    //Application entry point
    void __cdecl main()
    void ;StartGame()
    {

    StartGame();

    }



    warning C4518: 'void ' : storage-class or type specifier(s) unexpected here; ignored
    error C2146: syntax error : missing ';' before identifier 'StartGame'
    warning C4508: 'StartGame' : function should return a value; 'void' return type assumed

    Guess this won't be going any where :/
     
  11. gs37

    gs37 Robust Member

    Joined:
    May 22, 2012
    Messages:
    272
    Likes Received:
    3
    You can't reference a function from within the function. Well, you can... but for your case you can't. Try this:

    StartGame()
    {
    //blah
    }

    StartGame();
     
  12. weinerschnitzel

    weinerschnitzel Spirited Member

    Joined:
    Sep 23, 2012
    Messages:
    153
    Likes Received:
    13
    So this will work:
    Or this:

    Keep at it, once you have a basic understanding on C/C++ you will able to have some fun pretty quickly. Watch those semicolons! And have a look at libretro/RetroArch project at some point ;)
     
  13. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    Thanks man! I'll certainly give that a shot.
    With the XDK aside, I'm currently learning C++ from a book what's the best approach to that? It's been a while since I've studied from a text book... What would you recommend?
     
  14. weinerschnitzel

    weinerschnitzel Spirited Member

    Joined:
    Sep 23, 2012
    Messages:
    153
    Likes Received:
    13
    Like, the best approach to reading a textbook?
    Skimming for concepts and grasping those concepts from examples/visual aids tends to be the fastest way for me, but sometimes I need to read a full description.

    I would recommend taking a class that teaches some of the easy stuff later. Start with arrays before becoming dependent on vectors. There are plenty of online reference materials and concise books out there, but they can't answer your questions!
     
  15. gs37

    gs37 Robust Member

    Joined:
    May 22, 2012
    Messages:
    272
    Likes Received:
    3
    I think either Harvard or MIT offer free recorded lectures about programming online.
     
  16. CodeAsm

    CodeAsm ohci_write: Bad offset 30

    Joined:
    Dec 22, 2010
    Messages:
    1,500
    Likes Received:
    176
    I got C++ lessons on school and I must say, reading a book from front to back and doing some examples learned me allot. and it took only 2 month to actualy build nice tools already. Now im so busy with an internship I almost have no time for xbox dev, but realy like to start something. I would say, start some reading and try stuff (with you already do Nice :p)
    Im no expert on C or Xbox, but when one knows some Cpp and some basic xbox dev things you get things started. I hope more people are into xbox dev soon :D
     
  17. HEX1GON

    HEX1GON FREEZE! Scumbag

    Joined:
    May 4, 2011
    Messages:
    9,916
    Likes Received:
    837
    I'll have to get various different books to read from about it. I'll surely jump into it at some stage.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page