Issue with compiling. Help will be much appreciated. :) menu

User Tag List

Results 1 to 12 of 12
  1. #1
    Zezh's Avatar Member
    Reputation
    11
    Join Date
    May 2008
    Posts
    83
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issue with compiling. Help will be much appreciated. :)

    Hi there,

    I recently (today) started to experiment with c++. So i got myself this Microsoft visual c++ 2008 express edition.

    Now the thing is, when i try to compile the classic "hello world" script, there appears to be some error with a default -int.

    The script i am using is :

    #include <iostream>

    main()
    {
    std::cout << "Hello World" << std::endl;
    }

    After the compiler finished compiling it, I get this error:

    1>------ Build started: Project: Test123, Configuration: Debug Win32 ------

    1>Compiling...

    1>test123.cpp

    :wave:1>c:\users\^%#$)(\documents\visual studio 2008\projects\test123\test123\test123.cpp(4) : :yuck:error C4430: missing type specifier - int assumed. Note: C++ does not support default-int:confused:

    1>Build log was saved at "file://c:\Users\^%#$)(\Documents\Visual Studio 2008
    \Projects\Test123\Test123\Debug\BuildLog.htm"
    1>Test123 - 1 error(s), 0 warning(s)

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Some tips into the right direction, or a solution would be much appreciated and I will def. +rep you

    Thanks in advance.

    Issue with compiling. Help will be much appreciated. :)
  2. #2
    TinusNED's Avatar Banned
    Reputation
    42
    Join Date
    Aug 2008
    Posts
    333
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Replace main() with int main()
    that should work
    I had same problem in Visual Studio 2008

  3. #3
    Zezh's Avatar Member
    Reputation
    11
    Join Date
    May 2008
    Posts
    83
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for helping me out that fast. +Rep'd you.

    So i tried placing "int" in front of main, and it did work. thanks.

    But now, I have encountered another problem. *sigh*

    Whenever I try to run the program (f5) it says:

    :wave:skip this:wave:: Test123.exe': Loaded 'C:\Users\^%$()\Documents\Visual Studio 2008\Projects\Test123\Debug\Test123.exe', Symbols loaded.
    'Test123.exe': Loaded 'C:\Windows\System32\ntdll.dll'
    'Test123.exe': Loaded 'C:\Windows\System32\kernel32.dll'
    'Test123.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none _96748342450f6aa2\msvcp90d.dll'
    'Test123.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none _96748342450f6aa2\msvcr90d.dll'

    until this part:
    The program '[6256] Test123.exe: Native' has exited with code 0 (0x0).

    So after i press f5 it opens the cmd but it disappears as soon as it is opened.

  4. #4
    TinusNED's Avatar Banned
    Reputation
    42
    Join Date
    Aug 2008
    Posts
    333
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    U could use this code:

    Code:
    #include <iostream>
    
    int main()
    using namespace std; //no need for std:: anymore now
    
    {
    cout << "Hello World" << endl;
    
    system ("Pause");
    
    return 0;
    }
    I don't have a C++ compiler right now so can't test it
    Last edited by TinusNED; 08-05-2008 at 09:21 AM.

  5. #5
    Zezh's Avatar Member
    Reputation
    11
    Join Date
    May 2008
    Posts
    83
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not working either, this sure is interesting

  6. #6
    TinusNED's Avatar Banned
    Reputation
    42
    Join Date
    Aug 2008
    Posts
    333
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Zezh View Post
    That's not working either, this sure is interesting
    Hmm I have no idea then
    I updated the code by the way once. So u might have the old one I posted :P
    But I don't think that's the problem

  7. #7
    Zezh's Avatar Member
    Reputation
    11
    Join Date
    May 2008
    Posts
    83
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, i saw you forgot those {} so i implemented them already, thanks for trying to help though

  8. #8
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sigh...

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout >> "Hello world!" >> endl;
    system("pause");
    return 0;
    }
    See the difference?

  9. #9
    TinusNED's Avatar Banned
    Reputation
    42
    Join Date
    Aug 2008
    Posts
    333
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Sigh...

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout >> "Hello world!" >> endl;
    system("pause");
    return 0;
    }
    See the difference?
    I see,

    U use >> "Hello World >>, well now you say it, I did now that. But I didn't had an C++ compiler to test if my code was right =D

  10. #10
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by TinusNED View Post
    I see,

    U use >> "Hello World >>, well now you say it, I did now that. But I didn't had an C++ compiler to test if my code was right =D
    No.

    You declared your namespace INSIDE your main method. Look at your code compared to mine.

    (And the >> was a typo on my part, it should be <<. Being tired and coding != good)

  11. #11
    TinusNED's Avatar Banned
    Reputation
    42
    Join Date
    Aug 2008
    Posts
    333
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha yes. Now I see

  12. #12
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You all fail. How's that?
    Last edited by Cypher; 08-12-2008 at 05:29 AM.

Similar Threads

  1. Immortal Bot help, much appreciated from a Wiz! Please! will rep
    By taehanpak in forum Diablo 3 Bots Questions & Requests
    Replies: 3
    Last Post: 07-14-2012, 02:05 AM
  2. Problem With Character Models. Help Very Much Appreciated.
    By Sionte in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 07-14-2008, 01:50 AM
  3. Need help! got problem with Ascent.exe will +rep :P
    By Anthraxx in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-26-2008, 10:12 AM
  4. I need some help with Compiling
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-28-2007, 03:14 AM
  5. Trouble with MyWarcraftStudio, help greatly appreciated
    By kekburtbhkeke in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 04-28-2007, 05:22 PM
All times are GMT -5. The time now is 05:51 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search