-
April 17th, 2010, 04:51 PM
#1
Small error need help!
I am using visual c++ 2010. I need help with a small error!
Error:
[code1]> Run.cpp
1>Run.cpp(16): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(122): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/code]
I don't understand it much. I am new to c++ I don't have much of a clue what I am doing. xP So yah.. how can I fix this?
-
April 17th, 2010, 04:55 PM
#2
Re: Small error need help!
Error:
Code:
> Run.cpp
1>Run.cpp(16): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(122): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Reposted the error sorry for double posting but it won't let me edit my posts. xD
-
April 17th, 2010, 05:05 PM
#3
Re: Small error need help!
Without seeing the code that's responsible for the error it's hard to say what's going on.
-
April 17th, 2010, 05:07 PM
#4
Re: Small error need help!
Oh sorry here like I said I am new. :P I am trying to make a mmorpg out of c++ my friend did..
Code:
int server () {
cout << "Server Online!";
return 0;
} {
static Combat() { // Combat
int lifepoints ();
int attack ();
int power ();
int defense ();
int magic ();
int archery ();
} {
static Skills () { // Skills
int woodcutting ();
int firemaking ();
int fishing ();
int cooking ();
int theft ();
int endurance ();
int riding ();
int sailing ();
int construct ();
} {
static mount classes () { // Mounts
int birds ();
int dragovians ();
int reptillian ();
int fish ();
} {
public void level () { // Levels
// Combat
int running (100%);
int combat level (5);
int lifepoints level (5);
int attack level (0);
int power level (0);
int defense level (0);
int magic level (0);
int archery level (0);
// Skills
int woodcutting level (0);
int firemaking level (0);
int fishing level (0);
int cooking level (0);
int theft level (0);
int endurance level (0);
int riding level (0);
int sailing level (0);
int construct level (0);
}
public void MaxCombat () { // Max Combat Level
static int (140);
}
public void MaxLevel () { // Max Levels
static int (100);
}
public void woodcutting () { // Woodcutting
if (misc.random(treechance) != 0) return;
final int treeID = treetype;
final int Treetimer = treetimer;
int stumpID = 1341;
final int X = treeX;
final int Y = treeY;
for (int i = 0; i < server.playerHandler.maxPlayers; i++) {
if (server.playerHandler.players[i] != null) {
client c = (client) server.playerHandler.players[i];
c.createobject(stumpID, X, Y, 0, -2, 10);
if (c.chopping) {
c.frame1();
if (c.treeX == X && c.treeY == Y) {
chopping = false;
}
}
}
}
EventManager.getSingleton().addEvent(
new Event() {
public void execute(EventContainer C) {
for (int i = 0; i < server.playerHandler.maxPlayers; i++) {
if (server.playerHandler.players[i] != null) {
client c = (client) server.playerHandler.players[i];
c.createobject(treeID, X, Y, 0, -2, 10);
}
}
C.stop(); // stops the event from running
}
}, Treetimer * 600);
}
if (choptimer > 0) {
choptimer--;
}
if (chopping && freeSlots() <= 0) {
chopping = false;
cout << "Your inventory is full";
}
if (chopping && choptimer <= 0) {
addSkillXP(chopXP, 8);
addItem(logID, 1);
cout << "You chop some"; + getItemName(logID).toLowerCase());
choptimer = misc.random(calcchop(logID));
treefall();
}
if (chopping) {
setAnimation(wcemote);
}
Thanks
-
April 17th, 2010, 05:27 PM
#5
Re: Small error need help!
There's a lot of wierd stuff going on here..
Code:
static Combat()
{ // Combat
int lifepoints ();
Is this a mistake or deliberate?
Last edited by S_M_A; April 17th, 2010 at 05:29 PM.
-
April 17th, 2010, 05:33 PM
#6
Re: Small error need help!
I don't know what you mean I said I am new to this. How do I fix it all? I said I am trying to make a mmorpg from c++.. xP How do I fix it? I don't understand what you mean by posting the same codes I have on it O_o
-
April 17th, 2010, 05:58 PM
#7
Re: Small error need help!
I said I am trying to make a mmorpg from c++
Say what ? You are trying to make mmorpg and you don't have a clue about C++ ?
Here's a tip. Start learning C++. By the time you understand the basics, you can start working on learning how to program. After that, try to make a simple tetris clone to find out that you are one half there.
-
April 17th, 2010, 06:01 PM
#8
Re: Small error need help!
What is wrong with making a mmorpg while learning c++ at the same time? xP Please stop being offtopic I really need help
-
April 17th, 2010, 06:21 PM
#9
Re: Small error need help!
Originally Posted by Mod Hidden
What is wrong with making a mmorpg while learning c++ at the same time?
Understanding the basics of a mmorpg takes you 2 years of experience. Actually help building one roughly 5 years. I'm not trying to make phun of you, but you are going at it the wrong way. S_M_A showed you where the errors come from... google for how functions are defined.
-
April 17th, 2010, 06:24 PM
#10
Re: Small error need help!
You mean them little red things in his [code] I removed them but got stuck... >_<
When I remove
Code:
#include "stdafx.h"
#include <iostream>
#include <intrin.h>
using namespace std;
int server () {
cout << "Server Online!";
return 0;
}
void static Combat() { // Combat
static int lifepoints;
static int attack;
static int power;
static int defense;
static int magic;
static int archery;
}
void static Skills () { // Skills
static int woodcutting;
static int firemaking;
static int fishing;
static int cooking;
static int theft;
static int endurance;
static int riding;
static int sailing;
static int construct;
}
void static mount () { // Mounts
static int birds;
static int dragovians;
static int reptillian;
static int fish;
} {
public void level () { // Levels
// Combat
int running (100%);
int combat level (5);
int lifepoints level (5);
int attack level (0);
int power level (0);
int defense level (0);
int magic level (0);
int archery level (0);
// Skills
int woodcutting level (0);
int firemaking level (0);
int fishing level (0);
int cooking level (0);
int theft level (0);
int endurance level (0);
int riding level (0);
int sailing level (0);
int construct level (0);
}
public void MaxCombat () { // Max Combat Level
static int (140);
}
public void MaxLevel () { // Max Levels
static int (100);
}
public void woodcutting () { // Woodcutting
if (misc.random(treechance) != 0) return;
final int treeID = treetype;
final int Treetimer = treetimer;
int stumpID = 1341;
final int X = treeX;
final int Y = treeY;
for (int i = 0; i < server.playerHandler.maxPlayers; i++) {
if (server.playerHandler.players[i] != null) {
client c = (client) server.playerHandler.players[i];
c.createobject(stumpID, X, Y, 0, -2, 10);
if (c.chopping) {
c.frame1();
if (c.treeX == X && c.treeY == Y) {
chopping = false;
}
}
}
}
EventManager.getSingleton().addEvent(
new Event() {
public void execute(EventContainer C) {
for (int i = 0; i < server.playerHandler.maxPlayers; i++) {
if (server.playerHandler.players[i] != null) {
client c = (client) server.playerHandler.players[i];
c.createobject(treeID, X, Y, 0, -2, 10);
}
}
C.stop(); // stops the event from running
}
}, Treetimer * 600);
}
if (choptimer > 0) {
choptimer--;
}
if (chopping && freeSlots() <= 0) {
chopping = false;
cout << "Your inventory is full";
}
if (chopping && choptimer <= 0) {
addSkillXP(chopXP, 8);
addItem(logID, 1);
cout << "You chop some"; + getItemName(logID).toLowerCase());
choptimer = misc.random(calcchop(logID));
treefall();
}
if (chopping) {
setAnimation(wcemote);
}
In red I put in my code
I get this error now..
Code:
1> Run.cpp
1>Run.cpp(42): error C2059: syntax error : 'public'
1>Run.cpp(42): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(42): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(63): error C2059: syntax error : 'public'
1>Run.cpp(63): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(63): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(66): error C2059: syntax error : 'public'
1>Run.cpp(66): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(66): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(69): error C2059: syntax error : 'public'
1>Run.cpp(69): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(69): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(102): error C2059: syntax error : 'if'
1>Run.cpp(102): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(102): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(106): error C2059: syntax error : 'if'
1>Run.cpp(106): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(106): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(111): error C2059: syntax error : 'if'
1>Run.cpp(111): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(111): error C2447: '{' : missing function header (old-style formal list?)
1>Run.cpp(119): error C2059: syntax error : 'if'
1>Run.cpp(119): error C2143: syntax error : missing ';' before '{'
1>Run.cpp(119): error C2447: '{' : missing function header (old-style formal list?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What do I do now?
-
April 17th, 2010, 06:42 PM
#11
Re: Small error need help!
I thought that pointing out some of the weird things in the previous listing would lead to that the OP put some effort in making it all correct but the last listing prove me wrong... I totally agree with Skizmo here, there's so many basic error's here that you really should start learning C++ before taking any other task.
-
April 17th, 2010, 06:45 PM
#12
Re: Small error need help!
Well I really want to do it while I am learning. If I don't in the future I will forget everything I wanted for my mmorpg. xD I already have everything laid out and if I stop now just to learn C++ I won't do it in the future then it will all end up pretty much meaningless Can you guys please help me with these errors? Do I need to find another support c++ forum? Because I don't like wasting my time.
-
April 17th, 2010, 07:49 PM
#13
Re: Small error need help!
Originally Posted by Mod Hidden
Well I really want to do it while I am learning. If I don't in the future I will forget everything I wanted for my mmorpg. xD I already have everything laid out and if I stop now just to learn C++ I won't do it in the future then it will all end up pretty much meaningless Can you guys please help me with these errors? Do I need to find another support c++ forum? Because I don't like wasting my time.
This is what you call running before you learn to walk. Your syntax is totally off. You'd be better off getting a few "Hello, World" programs to compile before you try a MMO (which is an incredibly difficult undertaking regardless of your C++ knowledge)
-
April 17th, 2010, 07:54 PM
#14
Re: Small error need help!
Thanks guys for ruining my dreams. You wasted alot of my time. All I asked was help to fix a few errors instead you spam my thread with stuff that tell me, "give up you'll never make one ever." thanks your all so helpful.
[edit]
Finally can edit. :P
Please email me when you guys start giving actual help thanks
Last edited by Mod Hidden; April 17th, 2010 at 07:57 PM.
-
April 17th, 2010, 08:06 PM
#15
Re: Small error need help!
Originally Posted by Mod Hidden
Thanks guys for ruining my dreams. You wasted alot of my time. All I asked was help to fix a few errors instead you spam my thread with stuff that tell me, "give up you'll never make one ever." thanks your all so helpful.
[edit]
Finally can edit. :P
Please email me when you guys start giving actual help thanks
This isn't a "few errors." There's really no option but to re-write this thing from scratch, using C++, because that certainly wasn't what you wrote this in. Nobody said you couldn't do this, but as it stands now, you do not have a program that is written in C++, or C, or Java, or any other language I've seen before.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|