01-06-2006 4:30 PM
I am trying to write a program in C++ which uses the RFCs. I am using UNICODE and would like to use g++ to compile my programs. Here is the simpleist program that I can come up with which I can't compile. How can I compile this program? I can compile it is a C program, but NOT as a C++ program.
#include "saprfc.h"
#include "sapitab.h"
#include "sapucx.h"
#include <stdio.h>
int main()
{
printfU(cU("hello\n"));
return 0;
}
01-06-2006 10:00 PM
Hi Maribeth,
Here is hard to finf a quick answer but you can compile your .c code like this:
as good as i remember is ...
gcc <nme>.c
Please dont forget to reward....
Gabriel P.
01-06-2006 10:05 PM
I can already compile regular C programs. I cannot compile c++ programs.
01-06-2006 10:13 PM
Sorry....my mistake
you should do it on your shell like this.
g++ name.C -o name
or check this link.
http://galton.uchicago.edu/~gosset/Compdocs/gcc.html
Gabriel P,
01-09-2006 1:47 PM
Gabriel,
You are not understanding the problem, or, perhaps, I'm not explaining it well enough. I know how to compile C++ programs. The problem is when I try to compile C++ programs using the Unicode version of the SAP RFC SDK. If you look at my source code, you will see that it has some of the Unicode functions supported by the RFC SDK. How can I compile that with the C++ compiler. If you do a cut and paste of the code I posted and try to compile it with the instructions you posted, you will see the problem. That is assuming, of course, you have the SAP RFC SDK.
01-11-2006 2:30 PM
I figured this out. You need to use the WCHAR_is_2B define on the compile line. But that's only if use gcc/g++.