Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Strange redefinition error

Name: Anonymous 2009-03-26 18:49

For some reason I'm getting the following errors:
"redefinition of 'class TsuPod'" on line 19 of tsuPod.cpp
"previous definition of 'class TsuPod'" on line 21 of tsuPod.h

I don't know why I'm getting this error, since I've put header guards in my header files. I'm obviously doing something wrong, but I can't think of what it is. Can you guys help me out?

The files can be found at the following pastebin URLs:
http://pastebin.com/d20e4c6ca
http://pastebin.com/d53fae205
http://pastebin.com/d45cfd9b9
http://pastebin.com/d5829586f
http://pastebin.com/d192e7e4

Name: Anonymous 2009-03-26 18:55

You redefined TsuPod.

Name: Anonymous 2009-03-26 18:57

That's a lot of effort put into a poor troll. Read an introductory text on Sepples.

Name: Anonymous 2009-03-26 19:00

>>2
Obviously, but how do I fix it?

>>3
For what it's worth, I'm not a troll, I was just hoping some guys on the internet might be willing to help me out.

Name: Anonymous 2009-03-26 19:09

If you put the declarations into

class TsuPod
{
    public:
...
};


in the header file, you have closed the definition of the class.  put the definitions into the source file without the

class TsuPod
{
    public:
...
};


as e.g.

    int TsuPod::getTotalMemory()
    {
        return totalMemory;
    }


as in http://pastebin.com/m56b0d7d4

Name: Anonymous 2009-03-26 19:16

>>4
I was just hoping some guys on the internet might be willing to help me out.

Wrong fucking place.

Name: Anonymous 2009-03-26 19:20

>>5
Why did having the declarations like that in song.h not cause a problem then? Although your solution works, I'm just trying to understand what's going on.

Anyway, now that I'm using the file you pointed me to, I found some more errors. I was able to fix all but one. The new file can be found here: http://pastebin.com/d2f9dcd38

Name: Anonymous 2009-03-26 19:21

>>6
Just call me retardedly optimistic.

Name: Anonymous 2009-03-26 19:24

>>7
Are you actually compiling song.cpp?

Name: Anonymous 2009-03-26 19:30

>>9
I'm using Dev-C++ to compile my code, and I have everything in the same project. Is there some weirdness with Dev-C++ that might make it try to compile this wrong?

Name: Anonymous 2009-03-26 19:33

By the way, the error is
"In member function 'bool TsuPod::addSong(Song)': invalid use of member (did you forget the '&' ?)" on line 43 of tsuPod.cpp

Name: Anonymous 2009-03-26 19:56

>>9
It turns out it wasn't getting compiled, because it turns out it wasn't working like I said it was in >>7. For whatever reason Dev-C++ neglected to alert me to that. I'm working on fixing it now.

Name: Anonymous 2009-03-26 20:01

Dipshit is a dipshit.

Name: Anonymous 2009-03-26 20:12

SEPPLES FAGGOTS

The c in c++ stands for COCKS

Name: Anonymous 2009-03-26 20:16

I'd advise using something that actually gets updated, like Code::Blocks (http://www.codeblocks.org/), instead of Dev-C++, which hasn't been updated in over 4 years.

Name: Anonymous 2009-03-26 20:29

Alright, now that I've fixed some things and I'm compiling using the command line, I'm only getting one error message:
tsuPod.cpp: In member function `bool TsuPod::addSong(Song)':
tsuPod.cpp:43: error: invalid use of member (did you forget the `&' ?)

Anybody know what's causing this?
I've also reuploaded the source files because I've fixed a few things.
http://pastebin.com/d324ff3a8
http://pastebin.com/d7c95a993
http://pastebin.com/d4ecb4698
http://pastebin.com/d72c6ad10
http://pastebin.com/d6e434a63

Oh, and I forgot to thank >>5 for helping me out, so thanks.
And if >>9 hadn't mentioned that song.cpp might not be compiling, I wouldn't have tried compiling using command line, which was showing more errors than Dev-C++ for whatever reason.

Name: Anonymous 2009-03-26 20:31

For the sake of my faith in humanity, I'm going to pretend these Windows Sepples ``programming'' dipshits are all the same person, trolling us exponentially.

Name: Anonymous 2009-03-26 20:38

>>15
WHAT? Then why the hell does my school recommend it? Stupid university.

Name: Anonymous 2009-03-26 20:44

>>18
I don't think you go to a university. Enjoy your community college.

Name: Anonymous 2009-03-26 20:45

>>18
Considering that it uses Sepples to teach in the first place, I think you may already have your answer.

Name: Anonymous 2009-03-26 20:58

D'oh! I forgot to put the () at the end of a function call.

What's Sepples anyway?

Name: Anonymous 2009-03-26 21:16

>>21
What's Sepples anyway?
In case you're wondering why people are being hostile, it's because of shit like this. If you're going to be a cunt and demand we help you with your shitty homework problems, at least take the time to figure out how this works.

Name: Anonymous 2009-03-26 23:00

>>22
I haven't been demanding anything. I have been asking for help. If you don't want to, you can just ignore me. There is no reason to be hostile.

Name: Anonymous 2009-03-26 23:02

>>23
gb2/pr/, sepplesfag.

Name: Anonymous 2009-03-26 23:33

>>23
/prog/'s ETERNAL SEPTEMBER COMETH

Name: Anonymous 2009-03-26 23:57

>>25
Eternal, or until 7chan comes back up. Places like /pr/ serve the important purpose of keeping the dumbest of the dumb off my /prog/.

Name: Anonymous 2009-03-27 0:18

>>26
haev u read ur sicp 2day? :lol:

Name: Anonymous 2009-03-27 1:52

>>25
It's here.

// ==UserScript==
// @name           Eternal September
// @namespace      http://dis.4chan.org/prog/
// @description    It cometh.
// @include        http://dis.4chan.org/*;
// ==/UserScript==

var dates = document.querySelectorAll(".posterdate");
for(var i = 0; i < dates.length; i -=- 1) {
    var m = /(\d+)-(\d+)-(\d+)\s+(\d+)\:(\d+)/(dates[i].textContent);
    if(!m)
        return;
   
    var d = new Date(m[1], m[2], m[3], m[4], m[5]) - new Date(1993, 8, 31);
    d = (d-d%86400000)/86400000;
    dates[i].textContent = "1993-09-" + d + " " + m[4] + ":" + m[5];
}


PS. Shiichan will doubtlessly insert a semicolon after the @include URL, so please remove that. If your browser doesn't support querySelectorAll, get a real one or change it.

Name: Anonymous 2009-03-27 1:57

(I probably should have used getElementsByClassName, really.)

Name: Anonymous 2009-03-27 1:59

fucking disgusting indentation style

Name: Anonymous 2009-03-27 2:00

>>28
>i -=- 1
It might look cool and get you some brownie points with your mother and friends from community college, but you do realise this will actually perform a hardware subtraction right?

Name: Anonymous 2009-03-27 2:06

>>31
its i++

Name: Anonymous 2009-03-27 2:19

How is it possible, in this day and age, that people can still see FrozenVoid's posts? Could someone please explain this to me? Thanks

Name: Anonymous 2009-03-27 2:20

>>32
Thanks chief, I'm sure you got an A+ on your psychology test. Now back to /retarded/ please

Name: Anonymous 2009-03-27 4:23

>>28
FrozenVoid‽

Name: Anonymous 2009-03-27 4:47

so, has anyone noticed that using namespace std; could stand for using namespace sexually transmited desease?

Name: Anonymous 2009-03-27 5:04

>>36
No, all C++ standards specify it as the "standard namespace abbreviated std."

Name: Anonymous 2010-03-23 17:21

did you ever get the program done?

Name: Anonymous 2010-10-12 0:50

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Don't change these.
Name: Email:
Entire Thread Thread List