How to create a global class?

Started by
16 comments, last by Pure Krome 22 years, 1 month ago
quote:Original post by SabreMan
I don''t need this pointed out to me.




Im utterly sorry for trying to share information.
I just thought that someone that do point out that memory leak also would be intrested in seeing it solved, I assumed that you would have also supplied the C++ report reference if you knew about it.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
Advertisement
quote:Original post by DigitalDelusion
Im utterly sorry for trying to share information.


It looks more to me like you''re trying to pursue me around various different threads and "score points" against me. It''s becoming very tedious very fast.


Calm down, people.

I was more concerned about this:
(std::ostream&)query

Does query have an (std::ostream) operator defined? Even if so... eww

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
quote:Original post by Kylotan

I was more concerned about this:
(std::ostream&)query

Does query have an (std::ostream) operator defined? Even if so... eww



Um ... i''m not sure what you mean there ???


I''m using mysql++ library, which i downloaded from the main MySql offical site.

The mysql web site is (any guesses?!) www.mysql.com.
The c++ library i downloaded and i''m using is from http://www.mysql.com/downloads/api-mysql++.html

there are some documentation found on the above link, btw. Maybe that can explain your answer?

if ''query'' does have an (std::ostream) operator defined, why is this bad? (remember i''m the newbie from the other thread )




-PK-
-PK-
Have you tried using just "query << buf" rather than "(std::ostream&)query << buf"?
quote:Original post by SabreMan
Have you tried using just "query << buf" rather than "(std::ostream&)query << buf"?


this is the result....

### Normal Compile of -SQAR-
##
#
make ../Bin/Sqar
make[1]: Entering directory `/home/pure/Sqar/Src''
g++ -Wall -g -pipe -I/usr/include/mysql -c -o Main.o Main.cc
g++ -Wall -g -pipe -I/usr/include/mysql -c -o Player.o Player.cc
Player.cc: In member function `void Player::Load(String, String)'':
Player.cc:45: choosing `std::basic_ostream&
std::operator<<(std::basic_ostream&, const char*) [with
_Traits = std::char_traits]'' over `SQLQuery& operator<<(SQLQuery&,
const mysql_ColData&)''
Player.cc:45: because worst conversion for the former is better than worst
conversion for the latter
make[1]: *** [Player.o] Error 1
make[1]: Leaving directory `/home/pure/Sqar/Src''
make: *** [default] Error 2
[pure@echobase Src]$


-PK-
-PK-
OK. I guess that''s not a good idea, then. The cast seems a little odd, but if you''ve gotta do it, you''ve gotta do it.

--
Cats cannot taste sweets.
There must be something wrong there, since MySQL++ doesn''t require you to cast it in order to send data to the Query object. So I am worried that you''re actually hiding some error elsewhere. I can''t see how it works by converting the Query to an ostream, since it''s not derived from ostream (according to my header files, anyway). Try casting buf to an SQLString instead?

Of course, if it works already, then it works. But if it doesn''t work, or stops working, check this as it looks very suspect.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

This topic is closed to new replies.

Advertisement