Game Development Community

Need help with MS-VC6 compiler warnings using STL

by Steven Peterson · in Technical Issues · 02/07/2006 (8:59 am) · 3 replies

Hey all, I'm working on a new resource. This is the first draft of a 'Calendar Manager' module for a larger project. I'm using the MS-VC6 compiler and it's spitting out the following warnings.

I suspect the problem is releated to my very elementry use of the STL [vector] and [string] but don't understand what i'm doing wrong or know where to look. Clicking the erorrs takes me either to ISTREAM or OSTREAM. Any suggestions?

Thanks for the help,
Steven



Here's the class header-file for the problem code -
Compiler out-put is below:

#ifndef TSKCALENDARMANAGER_H
#define TSKCALENDARMANAGER_H

#include <vector>
#include <string>
#include "tskEvent.h"
#include "taskManager.h"

using namespace std;
//using std::vector;
//using std::string;


class tskCalendarManager : public tskEvent {

	//friend class time;

public:

	~tskCalendarManager();		// destructor

	// Singleton-Pattern ensures only one instance
	static tskCalendarManager* getInstance();
	bool isInstance( tskCalendarManager* );
	
	virtual void destroy(); // calls the destructor
	
	// runs internal update procedure
	virtual void update( int secsPerGameHour, int pulse );	
	
	//void setSecsPerGameHour( int );
	void setHoursInDay( int );
	void setDaysInWeek( int );
	void setDaysInMonth( int );
	void setMonthsInYear( int );
	void setDayOfWeek( int day, time myTime );
	void setDateTime( int hour, int day, int month, int year, time myTime );

	void newDayName( string );
	void newMonthName( string );
	void clearDayNamesList();
	void clearMonthNamesList();

	/*  Need these?
	int getHoursInDay() const;
	int getDaysInWeek() const;
	int getDaysInMonth() const;
	int getMonthsInYear() const;
	*/

	// Gets entire date in one shot
	void getDateTime(int hour, int day, int month, int year, time myTime) const;  
			
	string getDayName( time* myTime )  const;		// Returns day name 
	string getMonthName( time* myTime ) const;	// Returns month name

private:

	tskCalendarManager();		// private constructor
	static tskCalendarManager* instance;

	// Private Methods
	void incrementTime( time );	// increments time 1 hour

	//  Private Members
	taskManager* tskMgr;		// pointer to taskManager

	int secsPerGameHour;
	int pulse;
	int hoursInDay;
	int daysInWeek;
	int daysInMonth;
	int monthsInYear;

	time currentTime;	// current game-time in real-world seconds
	time initialTime;	// initial game-time in real-world seconds
	long int totalTime;		// total time played in real-world seconds

	vector< string > dayNamesList;
	vector< string > monthNamesList;

};  // end class tskCalendarManager

#endif

#1
02/07/2006 (8:59 am)
And the compiler warnings...
--------------------Configuration: Torque Demo - Win32 Release--------------------
Compiling...
tskCalendarManager.cc
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream(234) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream(229) : while compiling class-template member function 'class std::basic_ostream<char,struct std::char_traits<char> > &__thiscall std::basic_ostream<char,struct std::char_traits<ch
ar> >::put(char)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream(234) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream(229) : while compiling class-template member function 'class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > &__thiscall std::basic_ostream<unsigned sh
ort,struct std::char_traits<unsigned short> >::put(unsigned short)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(46) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(41) : while compiling class-template member function 'bool __thiscall std::basic_istream<char,struct std::char_traits<char> >::ipfx(bool)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(46) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream(41) : while compiling class-template member function 'bool __thiscall std::basic_istream<unsigned short,struct std::char_traits<unsigned short> >::ipfx(bool)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(525) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(521) : while compiling class-template member function 'void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Copy(unsigned int)'

tskCalendarManager.obj - 0 error(s), 5 warning(s)
#3
02/07/2006 (10:05 am)
Using /EHs instead worked.

Would've never figured that out, and didn't know that resource was there...
Thanks!