Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: 1st VTM problem

  1. #1
    Join Date
    Mar 2008
    Posts
    40

    1st VTM problem

    Firstly, i'd like to say that i'm a total newbie to programming...well, kindof, i've done visual basic a while back in school for 2 years, but never really bothered with it as it was more so a class of ethics than actual programming.

    Anyway, I love the 3d buzz tutorials, they're THE best video tutorials out there as they are not boring, but ONE TINY LITTLE PROBLEM I have with the introduction to C++ is that I cannot get my code to link, like it does in the video.
    In the video at about 13:20, the following lines of code are typed up:

    Code:
    #include <iostream>
    
    main()
    Now once he types that, he goes on to create the 2 squiggly brackets, but he didn't explain how he got line 1 to link to line 3, because as a beginner, i'm ALREADY stuck, because something was pressed that they didn't tell anybody about.
    Either that, or on THEIR program, it automatically linked those lines, but on MINE, if I press enter to go to the next line, the link goes past main, therefore not allowing my code to run properly when I try to get the simple hello world output working.

    What I mean by the link is the black line to the left side of the text that goes down from the expand/close box next to line 1, down to line 3.

    As soon as I press enter, that link just goes down to the next line, therefore completely excluding main() and anything in main....

    I'm also not seeing the numbers next to the lines either.

    I hope this makes sense to the more experienced programmers, if not, I will provide an image showing you the problem, however that shouldnt be necessary.

    Thanks in advance everyone, in the mean time i'll look for a solution elsewhere, and keep this thread here with a solution if I find one, just in case other beginners get the same problem.

  2. #2
    Join Date
    May 2007
    Location
    Upstate, NY
    Posts
    504
    If you're referring to what I think you are, then you don't need to be concerned with that. It does not affect how your code works. It's simply a convenience feature that allows you to collapse sections of code in order to make the page smaller and quicker to navigate.

    Also I would recommend taking a stroll through the Thread of Information. I foresee another problem in your near future, to which the answer(s) would be contained in said thread.
    Last edited by Wren Akula; 02-11-2009 at 11:38 PM.
    The spice must flow.

  3. #3
    Join Date
    Mar 2008
    Posts
    40
    Yep, you're thinking of the right thing

    However I haven't been able to find a fix.
    This is what I type

    Code:
    #include <iostream>
    
    main()
    {
    std::cout <<"hello world!" <<std::endl;
    }
    Just like in the video.
    I then press CTRL+F5 now and down in the "output" tab it says the following:

    1>------ Build started: Project: Hello World, Configuration: Debug Win32 ------
    1>Compiling...
    1>hello world.cpp
    1>c:\documents and settings\nathan francis\my documents\visual studio 2008\projects\hello world\hello world\hello world.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>Build log was saved at "file://c:\Documents and Settings\Nathan Francis\My Documents\Visual Studio 2008\Projects\Hello World\Hello World\Debug\BuildLog.htm"
    1>Hello World - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Now the part that i'm mostly looking at is where it says:

    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    What on earth does that mean :S

    I also notice that next to:

    main()

    The green bar is actually yellow on that line as if that is where the error lays.

    I'm completely stumped with this lol, i'll take a look at that thread you linked me to a bit more thoroughly but I didn't see anything in relation to this problem.

    UPDATE

    I looked further down the thread and wanted to test if it was just the program that had the problem or if C++ had some updated language or what, so I copied and pasted the following code to see if it worked:

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    	cout << "Hello World\n";
    	return 0;
    }
    It built without problems, and It ran without problems... :S
    It seems that the code in the VTM was run using visual studio 2003, and only works with the 2003 version or less...I currently have the 2008 version so I guess i'm kinda stuffed on that one...
    I am purchasing the VTM's from 3d buzz, but now i'm beginning to wonder if it's even going to be helpful to me since the code they type will be essentially "out of date".
    What are your thoughts?
    Last edited by Otreum; 02-12-2009 at 04:27 AM.

  4. #4
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    7,272
    Yes, there are some issues with the videos where the code used in the video will not work exactly as typed in other compilers. Luckily, the Thread of Information has all these covered so as long as you pay attention to that thread and watch out for the issues mentioned within it, you should be fine. I would say 99% of the videos are perfectly valid so you shouldn't be worried. Even if you do get stuck somewhere, there are plenty of people here that can help you.

  5. #5
    Join Date
    Mar 2006
    Location
    South Australia
    Posts
    4,521
    Agreed. C++ Hasn't changed (at all) between 2003 and 2008. However, the IDE has changed, and some compilers have become more strict about what they will accept and what will generate an error.

    The problem you found is just one of these issues. Like Jeff said, all of the known problems with the code are documented in the thread of information. Most of them are minor changes brought about due to changes in the behaviour of the compiler.

    The overwhelming majority of the information taught in the VTMs will still be valuable, and you will learn a lot. The code (as in the design) is not out of date, at all. There are just some minor issues, and they are all documented.

  6. #6
    Join Date
    Mar 2008
    Posts
    40
    Thankyou heaps guys, you've restored my faith in the VTM's :P

    From what i've read (testimonies) on the forums here about the VTM's, there are many impressed people, even the experienced people were impressed.
    So hopefully I'll get the hang of it quickly and understand everything in the VTM's.
    I understand that I will have to learn some horrored mathematics, especially when it comes to the OGL or DX side of things (i'd prefer to learn Direct X), but what has to be done has to be done, at least now (compared to back in school), I have a good reason to learn maths, so I will have the motivation behind studying the things I need to know, which will help me.

    My ultimate goal is to have my own games engine and my own development studio, which I know will take many years on my own, however i'd rather spend many years working towards something that is a passion than to spend the rest of my life working some job that I really don't care about.

    I was working on a Total conversion mod for the game STALKER for about 3 years now, however without the developers supporting the modding community, I will not be able to realize my goals for the project, and it will end up being half arsed and not all that good, so I had no other option but to just go with making my own engine.

    Anyway...thats enough rambling, i'll make sure to refer to that thread of information, so thankyou all for helping me out with this

    BTW, how DO I get those numbers to show which line of code i'm on? And how do I manually set up those expandable sections of code?
    Last edited by Otreum; 02-12-2009 at 05:58 AM.

  7. #7
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by Otreum View Post
    how DO I get those numbers to show which line of code i'm on?
    go to tools->options->text editor->all languages
    check 'line numbers' under the display section.

  8. #8
    Join Date
    Mar 2008
    Posts
    40
    ^^ Thankyou, it looks neater already :P

  9. #9
    Join Date
    Dec 2007
    Posts
    198
    Quote Originally Posted by ComicSansMS View Post
    go to tools->options->text editor->all languages
    check 'line numbers' under the display section.
    Thanks, I was too afraid to ask that. I wonder why they buried it so deep

  10. #10
    Join Date
    Mar 2006
    Location
    South Australia
    Posts
    4,521
    It seems to be a common theme for IDEs. Turning on line numbers in Eclipse is just as painful. Luckily vim you can just type

    :set number

Page 1 of 3 123 LastLast

Posting Permissions

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