Cout<<string Function produces garbage output

Hi,
I am using ROOT 5.18 to build a TApplication. I have a particular template function of the following:

[code]#include
#include
using namespace std;

template get_input(T input, string message){

cout<<message;

cin>>input;
}[/code]

In the main() function, i make the following function call:

[code]void main() {

int input = 0;

get_input(input,"Please enter the number of beams: ");


}[/code]

What then happens is that cout dumps garbage and noise onto my screen and internal speaker. At first I thought it was a template problem, so I hard coded the type into the function definition. However, the result was the same. I then commented everything out of the get_input function so all it did was display the string, this caused the same output. This leads me to believe there is some difficulty pass a string to a function and having it displayed in ROOT. I tried using #include “Riostream.h” to see if maybe my choice of headers was a problem, but this didn’t seem to help either. I am kind of out of ideas and would love to have some feed back.
Thanks,
Andrew

PS I just decided to see what happens when I try:

[code]
void main() {

string message = “Test string”;

cout<<message;

}[/code]

When I run this, it fails just as the function did. Obviously there is some problem sending strings to cout in ROOT.

Hi,

Do you compile or interpret this code? (And/or can you provide a complete self contained example reproducing this problem?)

Cheers,
Philippe.

Hi,
This code is indeed compiled. It is running on Windows XP and being developed in VS++ 2005. I am pretty sure it is correctly configured with ROOT since I am able to perform plenty of other ROOT stuff like building TGraphs and interpolating etc. etc. Just can’t seem to use old fashioned C++ user interface.

[code]// ROOT Includes
#include “TCanvas.h”
#include “TAxis.h”
#include “TH2D.h”
#include “TObject.h”
#include “TStyle.h”
#include “TROOT.h”
#include “TRint.h”
#include “TApplication.h”
#include

void main(int argc, char **argv){

// Create interactive interface

// TRint *theApp = new TRint(“Field Emission”, &argc, argv, NULL, 0);
//theApp->Run();
TApplication *theApp = new TApplication(“Field Emission”, &argc, argv);

/// @todo Ask user for number of beams and temperature etc.
// Number of Beamlets
int num_beam = 0;

/** @todo Fix cout & string I/O with ROOT */
std::string message = "Please enter the number of beamlets you would like: ";

std::cout<<message;

}[/code]

Here is a sample of some of the output:

╚*ê D ‼ w∩XU☺       Ç♂∞     , ‼ 0Y> ░ ‼ u→@ /4♂U4   ?   s∩XU ▲@ ░ ‼ 4↔@ ☺    ↕♣
└ ‼ ░↨@ ☺   ↑/? É1? Å∩XU¬ ☼«⌡ÿ╔☺ ≡ ⌂⌡ÿ╔☺    É ‼
─8φα ‼ u→@ ╧4♂U    ≡ ‼ gpü|¬ ☼«⌡ÿ╔☺ ≡ ⌂·"└α╚ ‼ ¿]]√    └Üâ|ppü|            ∙↑@
   Actx    ☺   ÿ$  ─               ¶   ☺   ♠   4   ¶☺  ☺                       ☻
               ¶☻  £☺      [IY-░♥  2   Σ♥  ╥☻      Σ☻☻â╕♠  F      Ω☻      ╥╒î╤∞
  F   4
  ♦♥  ►   ♦   ╘   ☻   ☺   ¶☺  î☼  ☺   ☻   á►  ,♥  ☺   ♦   ╠‼  P►  ☻   ♠   ∟$  |
  ☻   SsHd,   ☺   ☺   ☺   ♣   ê   ☺   X☼  ,   Z   Z
          ☻   $   4   C : \ W I N D O W S \ W i n S x s \                  ☺  £☺
  ☺   [IY-£☻  2   ╨☻  ╥☻  ☻   Σ☻☻âñ♣  F   ∞♣  Ω☻  ♥   ╥╒î╤  F             Ω☻  ♦
  .¡j╪♀♀  F   T♀  ♦♥  ♣   d   ☺
☺  d☺  ☻   ,   n☻  αφ╙♂ñÆ╔☺☺                           ☺
           M i c r o s o f t . W i n d o w s . S y s t e m C o m p a t i b l e ,
 p r o c e s s o r A r c h i t e c t u r e = " x 8 6 " , p u b l i c K e y T o k
 e n = " 6 5 9 5 b 6 4 1 4 4 c c f 1 d f " , t y p e = " w i n 3 2 " , v e r s i
 o n = " 5 . 1 . 2 6 0 0 . 2 0 0 0 " S y s t e m   D e f a u l t   C o n t e x t
   M i c r o s o f t . W i n d o w s . G d i P l u s   d       °   4♥  ☻   ▐   ,
♦  ¿Q╖♂ñÆ╔☺☺                           ☺               ö   ♀♣              M i c
 r o s o f t . W i n d o w s . G d i P l u s , p r o c e s s o r A r c h i t e c
 t u r e = " x 8 6 " , p u b l i c K e y T o k e n = " 6 5 9 5 b 6 4 1 4 4 c c f
 1 d f " , t y p e = " w i n 3 2 " , v e r s i o n = " 1 . 0 . 2 6 0 0 . 5 5 1 2
 " C : \ W I N D O W S \ W i n S x S \ M a n i f e s t s \ x 8 6 _ M i c r o s o
 f t . W i n d o w s . G d i P l u s _ 6 5 9 5 b 6 4 1 4 4 c c f 1 d f _ 1 . 0 .
 2 6 0 0 . 5 5 1 2 _ x - w w _ d f b 5 4 e 0 c . M a n i f e s t   x 8 6 _ M i c
 r o s o f t . W i n d o w s . G d i P l u s _ 6 5 9 5 b 6 4 1 4 4 c c f 1 d f _
 1 . 0 . 2 6 0 0 . 5 5 1 2 _ x - w w _ d f b 5 4 e 0 c     M i c r o s o f t . W
 i n d o w s . N e t w o r k i n g . D x m R t p   d        ☺  P♠  ☻   µ   P  ╛'
ε♂ñÆ╔☺☺                           ☺               £                 M i c r o s
o f t . W i n d o w s . N e t w o r k i n g . D x m r t p , p r o c e s s o r A
r c h i t e c t u r e = " x 8 6 " , p u b l i c K e y T o k e n = " 6 5 9 5 b 6
4 1 4 4 c c f 1 d f " , t y p e = " w i n 3 2 " , v e r s i o n = " 5 . 2 . 2 .
3 " C : \ W I N D O W S \ W i n S x S \ M a n i f e s t s \ x 8 6 _ M i c r o s
o f t . W i n d o w s . N e t w o r k i n g . D x m R t p _ 6 5 9 5 b 6 4 1 4 4
c c f 1 d f _ 5 . 2 . 2 . 3 _ x - w w _ 4 6 8 4 6 6 a 7 . M a n i f e s t   x 8
6 _ M i c r o s o f t . W i n d o w s . N e t w o r k i n g . D x m R t p _ 6 5
9 5 b 6 4 1 4 4 c c f 1 d f _ 5 . 2 . 2 . 3 _ x - w w _ 4 6 8 4 6 6 a 7     M i
c r o s o f t . W i n d o w s . N e t w o r k i n g . R t c D l l   d        ☺
ä         ☻   µ   ä
♀ñÆ╔☺☺                           ☺               £   l♂              M i c r o s
 o f t . W i n d o w s . N e t w o r k i n g . R t c D l l , p r o c e s s o r A
 r c h i t e c t u r e = " x 8 6 " , p u b l i c K e y T o k e n = " 6 5 9 5 b 6
 4 1 4 4 c c f 1 d f " , t y p e = " w i n 3 2 " , v e r s i o n = " 5 . 2 . 2 .
 3 " C : \ W I N D O W S \ W i n S x S \ M a n i f e s t s \ x 8 6 _ M i c r o s
 o f t . W i n d o w s . N e t w o r k i n g . R t c D l l _ 6 5 9 5 b 6 4 1 4 4
 c c f 1 d f _ 5 . 2 . 2 . 3 _ x - w w _ d 6 b d 8 b 9 5 . M a n i f e s t   x 8
 6 _ M i c r o s o f t . W i n d o w s . N e t w o r k i n g . R t c D l l _ 6 5
 9 5 b 6 4 1 4 4 c c f 1 d f _ 5 . 2 . 2 . 3 _ x - w w _ d 6 b d 8 b 9 5     M i
 c r o s o f t . W i n d o w s . N e t w o r k i n g . R t c R e s   d       ∟☺
  lt←♀ñÆ╔☺☺                           ☺               ÿ   ╕♫      ♦   R☼  M i c
r o s o f t . W i n d o w s . N e t w o r k i n g . R t c R e s , l a n g u a g
e = " e n " , p r o c e s s o r A r c h i t e c t u r e = " x 8 6 " , p u b l i
c K e y T o k e n = " 6 5 9 5 b 6 4 1 4 4 c c f 1 d f " , t y p e = " w i n 3 2
" , v e r s i o n = " 5 . 2 . 2 . 3 " C : \ W I N D O W S \ W i n S x S \ M a n
i f e s t s \ x 8 6 _ M i c r o s o f t . W i n d o w s . N e t w o r k i n g .
R t c R e s _ 6 5 9 5 b 6 4 1 4 4 c c f 1 d f _ 5 . 2 . 2 . 3 _ e n _ 1 6 a 2 4
b c 0 . M a n i f e s t   x 8 6 _ M i c r o s o f t . W i n d o w s . N e t w o
r k i n g . R t c R e s _ 6 5 9 5 b 6 4 1 4 4 c c f 1 d f _ 5 . 2 . 2 . 3 _ e n
_ 1 6 a 2 4 b c 0   e n   ♥   `☼  ☻   x☼  ♥   Ç☼          ê   ╕   á   ╨   Φ   Ss
Hd,   ☺   ☺   ☺     ,   ☺   ∞☻          £Ωj,∞   ▬   ♦☺  ¶   ☻   ∞└ƒl↑☺  >   X☺
¶   ☻   k◄gPl☺  ¶   ä☺  ¶   ♥   ←º♫ÿ☺  <   ╪☺  ¶   ♥   Y6áα∞☺  ¶   ♦☻  ¶   ♦
╠@₧↑☻  <   X☻  ¶   ♦   ╡19╫l☻  ¶   ä☻  ¶   ♣   e╟┘öÿ☻  <   ╪☻  ¶   ♣   G d i P l
 u s . d l l   ¶   ☻               C : \ W I N D O W S \ s y s t e m 3 2 \ G d i
 P l u s . d l l   ¶
               d x m r t p . d l l     ¶   ☻               C : \ W I N D O W S \
 s y s t e m 3 2 \ d x m r t p . d l l     ¶
               r t c d l l . d l l     ¶   ☻               C : \ W I N D O W S \
 s y s t e m 3 2 \ r t c d l l . d l l     ¶
               r t c r e s . d l l     ¶   ☻               C : \ W I N D O W S \
 s y s t e m 3 2 \ r t c r e s . d l l     ¶
               ♥   ⌠☻  ☻   ♀♥  ☻   ¶♥  ♦   ∟♥  ,   ñ   \   ╝   D   t   î   ╘   G
sHd(   ☺   ☺   ☺   →   H☺      (   ▲☺  r t c d l l . d l l   d x m r t p . d l l
   d x m r t p . d l l   d x m r t p . d l l   d x m r t p . d l l   d x m r t p
 . d l l   d x m r t p . d l l   d x m r t p . d l l   d x m r t p . d l l   d x
 m r t p . d l l   d x m r t p . d l l   d x m r t p . d l l   d x m r t p . d l
 l     ►═↔A♂╙◄Ñe └OÄ÷π ♦  x   ♥   ◄═↔A♂╙◄Ñe └OÄ÷π►♣  x   ♥    £CeO`╩I¬é▄☺í
[ê♣  x   ♥   )ΩBz╖ó─@░æ÷≡$¬ë╛`☼  x   ♦   .Y╥╫┬☻éKÑu]♫°Φφ╓ÿ♦  x   ♥   5üåÇD6LIƒM╖
ò≤è     ╡H        x   ♥   8ƒúG☼⌂αL╖ê╫k9²jOá♂  x   ♥   <▀<2╩♀╙◄ûα ►K╟│¿p♫  x   ♥
  B▒úDü╧ΩB┤╤⌠=╓÷N╬└       x   ♥   `ûz)r╚£N╛↔rÆ╚εx╬h  x   ♥   w│\¶╗τ▀J╜Bñ#♦q~▐É♀
 x   ♥   û♠j5╠┐↕J╛Otû-♦╪Θ8
  x   ♥   Ü¢K≤!RÿC╖▌Θw╟ⁿ╨7↑♀  x   ♥   £↑▲┤┤φ¢Hæ╥╙
♥éτ¡Φ♫  x   ♥   £<♣≥╠¥HN▓║▌s ñQ?  x   ♥   ₧┐>ae╟oD┐ûw(╬WÆé≡♠  x   ♥   º↓F▄░îßIÆΣ
  x   ♥   ╢l\ìD♂ZJ╖àD├f╘µw  x   ♥   ┌cN¡∩├Å@üS☼╟╒┬ƒr░
  x   ♥   σ     ↔XE♂╙◄Ñe └OÄ÷π ♠  x   ♥   µR╢&╕╦♠LæâjR8Xp╪╪☼  x   ♦   ∞φgT╩♀╙◄ûα
  x   ♥   ·ü$å╫S▐A₧ⁿZæ¬ßx♠  x   ♥   x       ♦   ►═↔A♂╙◄Ñe └OÄ÷π.Y╥╫┬☻éKÑu]♫°Φφ╓►
═↔A♂╙◄Ñe └OÄ÷π                ¶   0☺                                      x
  ♦   ►═↔A♂╙◄Ñe └OÄ÷π.Y╥╫┬☻éKÑu]♫°Φφ╓►═↔A♂╙◄Ñe └OÄ÷π                ¶   0☺
[◄═↔A♂╙◄Ñe └OÄ÷π                ¶   →☺                                      x
[◄═↔A♂╙◄Ñe └OÄ÷π                ¶   →☺                                      x
    ♦   σ       ↔XE♂╙◄Ñe └OÄ÷π·ü$å╫S▐A₧ⁿZæ¬ßσ   ↔XE♂╙◄Ñe └OÄ÷π                ¶
  ♦☺                                      x       ♦   σ ↔XE♂╙◄Ñe └OÄ÷π·ü$å╫S▐A₧ⁿ
Zæ¬ßσ   ↔XE♂╙◄Ñe └OÄ÷π                ¶   ♦☺
  x       ♦   ₧┐>ae╟oD┐ûw(╬WÆé`ûz)r╚£N╛↔rÆ╚εx╬₧┐>ae╟oD┐ûw(╬WÆé                ¶
  ε                                       x       ♦   ₧┐>ae╟oD┐ûw(╬WÆé`ûz)r╚£N╛↔
rÆ╚εx╬₧┐>ae╟oD┐ûw(╬WÆé                ¶   ε
  x       ♦    £CeO`╩I¬é▄☺í
±q£<♣≥╠¥HN▓║▌s ñQ? £CeO`╩I¬é▄☺í
±q                ¶   ╪                                       x       ♦    £CeO`
╩I¬é▄☺í
±q£<♣≥╠¥HN▓║▌s ñQ? £CeO`╩I¬é▄☺í
±q                ¶   ╪                                       x       ♦   ╢l\ìD♂
ZJ╖àD├f╘µw5üåÇD6LIƒM╖ò≤è        ╡╢l\ìD♂ZJ╖àD├f╘µw                ¶   ┬
                             x       ♦   ╢l\ìD♂ZJ╖àD├f╘µw5üåÇD6LIƒM╖ò≤è ╡╢l\ìD♂Z
J╖àD├f╘µw                ¶   ┬                                       x       ♦
 B▒úDü╧ΩB┤╤⌠=╓÷N╬û♠j5╠┐↕J╛Otû-♦╪ΘB▒úDü╧ΩB┤╤⌠=╓÷N╬                ¶   ¼
                             x       ♦   B▒úDü╧ΩB┤╤⌠=╓÷N╬û♠j5╠┐↕J╛Otû-♦╪ΘB▒úDü╧Ω
B┤╤⌠=╓÷N╬                ¶   ¼                                       x       ♦
 ┌cN¡∩├Å@üS☼╟╒┬ƒr ·3╙9[▒BÇΘ♦V▬♠½√┌cN¡∩├Å@üS☼╟╒┬ƒr                ¶   û
                             x       ♦   ┌cN¡∩├Å@üS☼╟╒┬ƒr ·3╙9[▒BÇΘ♦V▬♠½√┌cN¡∩├Å
@üS☼╟╒┬ƒr                ¶   û                                       x       ♦
 8ƒúG☼⌂αL╖ê╫k9²jOÜ¢K≤!RÿC╖▌Θw╟ⁿ╨78ƒúG☼⌂αL╖ê╫k9²jO                ¶   Ç
                             x       ♦   8ƒúG☼⌂αL╖ê╫k9²jOÜ¢K≤!RÿC╖▌Θw╟ⁿ╨78ƒúG☼⌂α
L╖ê╫k9²jO                ¶   Ç                                       x       ♦
 w│\¶╗τ▀J╜Bñ#♦q~▐≡ºÆiwJ╓F╛╚gΦ←╗☻♦w│\¶╗τ▀J╜Bñ#♦q~▐                ¶   j
                             x       ♦   w│\¶╗τ▀J╜Bñ#♦q~▐≡ºÆiwJ╓F╛╚gΦ←╗☻♦w│\¶╗τ▀
J╜Bñ#♦q~▐                ¶   j                                       x       ♦
 ∞φgT╩♀╙◄ûα ►K╟│¿º↓F▄░îßIÆΣ¶ñ▒Tù▲∞φgT╩♀╙◄ûα ►K╟│¿                ¶   T
                             x       ♦   ∞φgT╩♀╙◄ûα ►K╟│¿º↓F▄░îßIÆΣ¶ñ▒Tù▲∞φgT╩♀╙
◄ûα ►K╟│¿                ¶   T                                       x       ♦
 <▀<2╩♀╙◄ûα ►K╟│¿£↑▲┤┤φ¢Hæ╥╙
♥éτ¡<▀<2╩♀╙◄ûα ►K╟│¿                ¶   >
x       ♦   <▀<2╩♀╙◄ûα ►K╟│¿£↑▲┤┤φ¢Hæ╥╙
♥éτ¡<▀<2╩♀╙◄ûα ►K╟│¿                ¶   >
x       ☺   )ΩBz╖ó─@░æ÷≡$¬ë╛µR╢&╕╦♠LæâjR8Xp╪)ΩBz╖ó─@░æ÷≡$¬ë╛                ¶
(                                       x       ☺   )ΩBz╖ó─@░æ÷≡$¬ë╛µR╢&╕╦♠LæâjR
8Xp╪)ΩBz╖ó─@░æ÷≡$¬ë╛                ¶   (
GsHd(   ☺   ☺   ☺   ☺   @       (   ▬   r t c d l l . d l l     ö &═►▐εJ¼s∩ç÷ß&â
\       ♦           ▬   (   ☺           ☺ ☺

... lots of whitespace

Hi,

So the problem is more than likely a compilation switch mismatch.

Do the problem still appears if you do not create the TApplication?

Cheers,
Philippe.

Yeah, it still happens when I take out the TApplication. It just seems to be a problem with the use of string and cout. I have no idea what’s going on. I don’t think this is a ROOT problem anymore, but just in case I am doing something dumb, here is the output of the following code.

#include <iostream>
int main() {
	std::string message = "Test message";
	std::cout<<message;
return 0;
} 

Produces

 c:\program files\microsoft visual studio 9.0\vc\include\ostream(653): could be 'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(700): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(738): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(785): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(909): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const signed char *)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(916): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,signed char)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(923): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const unsigned char *)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(930): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,unsigned char)' [found using argument-dependent lookup]
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(170): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits> &(__cdecl *)(std::basic_ostream<_Elem,_Traits> &))'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(176): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ios<_Elem,_Traits> &(__cdecl *)(std::basic_ios<_Elem,_Traits> &))'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(183): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::ios_base &(__cdecl *)(std::ios_base &))'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(190): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(210): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(short)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(243): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned short)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(263): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 int)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(288): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned int)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(308): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(328): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned long)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(349): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__int64)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(369): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(390): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(float)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(410): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(double)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(430): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(450): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(470): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_streambuf<_Elem,_Traits> *)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        while trying to match the argument list '(std::ostream, std::string)'

If anyone knows right off hand what this means, I would be very thankful for any advice. Otherwise I suppose I will direct my queries elsewhere.
Thanks,
Andrew

Try:

#include <string> #include <iostream> int main() { std::string message = "Test message"; std::cout<<message; return 0; }

Cheers,
Philippe.

Well, adding the #include did fix the problem in the simple example, it still has not fixed the problem in the ROOT program. Any additional thoughts would be appreciated.
Thanks,
Andrew

Philippe,
Thanks for your help. I finally figured out the problem myself. The _DEBUG flag had been set for the Release version of the compiled program. Therefore the executable’s string handling was not jiving with the preprocessor. Sorry for bringing it up.
Thanks,
Andrew