Menu

Functions

2008-03-09
2012-09-26
  • Drake Higgins

    Drake Higgins - 2008-03-09

    I am using Dev 4.9.9.2 on windows vista

    I used a different compiler in the past, and I am trying to muti functions, but it is not working, is there a different way to do it when using this compiler? Or am I making a mistake... it has been quite some time sense I have last programed ^.^

    EXAMPLE:

    include <iostream>

    using namespace std;

    int other();

    int main()
    {
    other();
    return 0;
    }

    int other()
    {
    cout << "Testing...\n";
    system("PAUSE");
    return 0;
    }

    Complier Log:

    Compiler: Default compiler
    Building Makefile: "C:\Stuff\Dev-Cpp\Makefile.win"
    Executing make...
    make.exe -f "C:\Stuff\Dev-Cpp\Makefile.win" all
    g++.exe -c Program.cpp -o Program.o -I"C:/Stuff/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Stuff/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Stuff/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Stuff/Dev-Cpp/include/c++/3.4.2" -I"C:/Stuff/Dev-Cpp/include"

    Program.cpp: In function `int main()':
    Program.cpp:79: error: expected primary-expression before "int"

    Program.cpp:79: error: expected `;' before "int"

    Program.cpp:86: error: expected primary-expression before "int"

    Program.cpp:86: error: expected `;' before "int"

    Program.cpp:93: error: expected primary-expression before "int"

    Program.cpp:93: error: expected `;' before "int"

    Program.cpp:98: error: expected `}' at end of input

    make.exe: *** [DragonOrb2Program.o] Error 1

    Execution terminated

    So could any one help me ^.^

    ~~~Drake~~~

     
    • cpns

      cpns - 2008-03-09

      >> Nevermind, the test works, but not the real program,

      We could tell that since the error was reported for lines 79 to 98 and teh code you posted has far fewer lines. Don't do that again - we will notice, and won't answer other than to suggest you post either th ereal code or the real log, since it would be entirely pointless.

      Clifford

       
    • Drake Higgins

      Drake Higgins - 2008-03-09

      Nevermind, the test works, but not the real program, sorry for not checking

       
    • Drake Higgins

      Drake Higgins - 2008-03-09

      Double sorry, fixed the problem... I did something very stupid... I forgot a } again, sorry for wasting space

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.