Mixing: Qbasic & C++
Posted: Mon Oct 20, 2008 1:29 am
Hello folks,
I had many experiences around mixing languages
e.g.
qbasic <-> assembly
qbasic <-> pascal
c++ -> qbasic
c++ <-> assembly
but i failed to make mix between qbasic & C++ ( C++ <- qbasic )
i think there is one method to do that,
declare qbasic function as pascal in c++
in qbasic
& i compiled qbasic code & generate qbtst.OBJ
in C++
finally, link all .OBJ files
and compiler say:
Linker Error: Undefined symbol addone in module F:\mix.CPP
need your comments
ThankX
Cheers,
Ahmad T. Dajani
I had many experiences around mixing languages
e.g.
qbasic <-> assembly
qbasic <-> pascal
c++ -> qbasic
c++ <-> assembly
but i failed to make mix between qbasic & C++ ( C++ <- qbasic )
i think there is one method to do that,
declare qbasic function as pascal in c++
in qbasic
Code: Select all
function addone%(n as integer)
addone%= n + 1
end function
in C++
Code: Select all
extern "C"{
int pascal addone(int);
}
main(){
int foo;
foo=addone(3);//foo must be 4
}
and compiler say:
Linker Error: Undefined symbol addone in module F:\mix.CPP
need your comments
ThankX
Cheers,
Ahmad T. Dajani