.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old August 7th, 2006, 05:11 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default OT: Stupid c++ (Roguelike development)

So I'm trying to declare a vector. It declares fine in the main function. The only problem is, I need to declare it in one of the header files. Except that if I try to declare it in function I want to use it in in the header file, it tells me that ' `vector' undeclared (first use this function)'.

If I try to declare it outside the function, it tells me that 'expected constructor, destructor, or type conversion before '<' token'

So it seems like my header file can't access the vector code or something.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #2  
Old August 7th, 2006, 06:11 PM
Cipher7071's Avatar

Cipher7071 Cipher7071 is offline
Second Lieutenant
 
Join Date: Nov 2003
Posts: 482
Thanks: 1
Thanked 0 Times in 0 Posts
Cipher7071 is on a distinguished road
Default Re: OT: Stupid c++

Assign them different names, and pass the value of one to the other.
__________________
The great tragedy of science...the slaying of a beautiful hypothesis by an ugly fact. (T. H. Huxley)
Reply With Quote
  #3  
Old August 7th, 2006, 07:13 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Stupid c++

That still doesn't fix the fact that I can't declare vectors in the header and the header is where I need to declare the vector.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #4  
Old August 7th, 2006, 07:19 PM
PvK's Avatar

PvK PvK is offline
National Security Advisor
 
Join Date: Dec 1999
Posts: 8,806
Thanks: 54
Thanked 33 Times in 31 Posts
PvK is on a distinguished road
Default Re: OT: Stupid c++

Vector isn't a built-in type, so you need to have something, typically in the header file, like:

#include <vector>

and probably you want:

using namespace std;

and then to declare it, something like:

vector <MouseCheeseWhatever> NarfsVector;
Reply With Quote
  #5  
Old August 7th, 2006, 09:34 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Stupid c++

Much thanks.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #6  
Old August 7th, 2006, 10:22 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Stupid c++

Would anyone happen to know why the computer would lock into 'drag and select' mode, generally requiring me to do a complete shut-down?

That's any part of the computer capable of 'drag and select' gets locked into that mode. It sometimes happens when I'm dragging and selecting.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #7  
Old August 8th, 2006, 01:31 AM
PvK's Avatar

PvK PvK is offline
National Security Advisor
 
Join Date: Dec 1999
Posts: 8,806
Thanks: 54
Thanked 33 Times in 31 Posts
PvK is on a distinguished road
Default Re: OT: Stupid c++

Sounds like your mouse button is getting stuck in a down position, or software (mouse driver, or some program messing with mouse messages in a bad way) is messing up the mouse. Like, saying it has handled the MouseUp message and not passing it on to other software, so other programs don't see the MouseUp event so it's like your mouse button is stuck down.
Reply With Quote
  #8  
Old August 8th, 2006, 04:22 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Stupid c++

I think it's my keyboard - Tapping the shift key has helped twice now, so it's probably dying.

The mouse is only about 6+ months old; can't remember when we got the keyboard, but it's outlasted at least two processors, I think.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #9  
Old August 8th, 2006, 05:44 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Stupid c++

What does 'expected primary-expression before '.' token' mean? I'm trying to make a pointer for a base class equal to one of its derived classes.

Thanks again.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #10  
Old August 8th, 2006, 05:48 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Stupid c++

Ah, the joys of dereferencing.

. is used to access members of an object.

-> is used to access members of an object when you have a pointer to that object.

If you have:

object* MyObjectPtr = new object();

then you have to access members via:

MyObjectPtr->member();

Whereas if you have just:

object MyObject;

you use:

MyObject.member();
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:38 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.