[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Does anyone face this problem?
From: |
Vijay Patil |
Subject: |
Does anyone face this problem? |
Date: |
Wed, 13 Oct 2004 03:53:29 -0700 (PDT) |
Hi all,
Im using
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
on 64bit linux server
im trying to compile following code
--------------------sam.cpp---------------------
#include <string>
#include <iostream>
#include <stdarg.h>
using namespace std;
void Write( const char* msg, const char* msg2, ...)
{
cout <<msg <<" "<<msg2<<endl;
}
int main()
{
string str("World");
Write("Hello","Debug out %s" ,str);
return 0;
}
-------------------------------------------
When i compile this code i get following compilation
error
[oracle@sahyagiri test]$ g++ sam.cpp
sam.cpp: In function `int main()':
sam.cpp:17: warning: cannot pass objects of non-POD
type `struct std::string'
through `...'; call will abort at runtime
When i run the executable, a.out it fails with Illegal
instruction eror
[oracle@sahyagiri test]$ ./a.out
Illegal instruction
[oracle@sahyagiri test]$
Did any one face this problem, if yes is there any one
workaround to this problem.
i guess this is a issue with compiler gcc 3.2.3
because i tries same this with gcc 2.95, though it
gives warning while compilation, but executable runs
with out any runtime error.
=====
Thanks and Regards
Vijay
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
- Does anyone face this problem?,
Vijay Patil <=