Calling CPP program in jbase
- Sairam
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
18 years 11 months ago #1779
by Sairam
Calling CPP program in jbase was created by Sairam
Hi All,
I m trying to call a CPP program from my jbase program. When i do that i m getting the error. First i tried to call a C Program from my jbase program with the steps that are given in this forum. It worked fine, when i changed the file from .c to .cpp i m getting an error. Can anyone help me out in calling a cpp program from a jbase program. Thanks in advance.
_________________
With Smile,
Sairam.B
I m trying to call a CPP program from my jbase program. When i do that i m getting the error. First i tried to call a C Program from my jbase program with the steps that are given in this forum. It worked fine, when i changed the file from .c to .cpp i m getting an error. Can anyone help me out in calling a cpp program from a jbase program. Thanks in advance.
_________________
With Smile,
Sairam.B
Please Log in or Create an account to join the conversation.
- malai
-
- Offline
- Platinum Member
-
Less
More
- Posts: 509
- Thank you received: 11
18 years 10 months ago #1780
by malai
Replied by malai on topic Calling CPP program in jbase
Can u post your sample C++ program here? In which jBASE release you are in?
_________________
M A L A I
_________________
M A L A I
Please Log in or Create an account to join the conversation.
- Sairam
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
18 years 10 months ago #1781
by Sairam
Replied by Sairam on topic Calling CPP program in jbase
Hi Malai,
Now i could able to call a cpp program from jbase. But when i tried the same thing in jbase4.1 using jcompile i got a different output. Here i have posted my cpp program and jbase program and the compilation steps.
CPP Program:(my.cpp)
#include <jsystem.h>
extern 'C' int ADD_TWO_NUMBER (int num1, int num2)
{
int result = num1 + num2;
return result;
}
jBase Program:(myb.b)
PROGRAM myb.b
DEFC INT ADD_TWO_NUMBER(INT,INT)
VAL1 = 10
VAL2 = 20
VAL3 = ADD_TWO_NUMBER(VAL1,VAL2)
PRINT VAL3
STOP
END
I compiled with this command.
jcompile myb.b my.cpp -o test.out
I got output as 102345, which is not the required one.
_________________
With Smile,
Sairam.B
Now i could able to call a cpp program from jbase. But when i tried the same thing in jbase4.1 using jcompile i got a different output. Here i have posted my cpp program and jbase program and the compilation steps.
CPP Program:(my.cpp)
#include <jsystem.h>
extern 'C' int ADD_TWO_NUMBER (int num1, int num2)
{
int result = num1 + num2;
return result;
}
jBase Program:(myb.b)
PROGRAM myb.b
DEFC INT ADD_TWO_NUMBER(INT,INT)
VAL1 = 10
VAL2 = 20
VAL3 = ADD_TWO_NUMBER(VAL1,VAL2)
PRINT VAL3
STOP
END
I compiled with this command.
jcompile myb.b my.cpp -o test.out
I got output as 102345, which is not the required one.
_________________
With Smile,
Sairam.B
Please Log in or Create an account to join the conversation.
Time to create page: 0.033 seconds