C Or C++
#1
Posted 22 June 2009 - 06:08 PM
ive already tried writing addins in C but im used to C++ (wrote some progs for PC)
ive heard you can write addins for the fx9860g in C or C++ and now i want to know:
1. Is it true??
2.If yes what features of C++ can you use?
3.What do you use, what do you admit?
#2
Posted 22 June 2009 - 07:19 PM
If you want to know more about making Addins for your calculator, please proceed to the Casio Educational online service: https://edu.casio.co...wnload_service/
From here you can download the SDK and the manuals for it.
#3
Posted 23 June 2009 - 12:58 AM
Building in the SDK regenerates the addin.mak, so build by running the .bat file in your project instead.
It is like C with classes. I like C.
#4
Posted 23 June 2009 - 03:36 AM
#5
Posted 23 June 2009 - 06:14 AM
ive tried your solution andreas B but i found out that "-lang=c" is automaticly changed to "-lang=cpp" if a .cpp-file is the source...
i can still run the whole sdk (not the .bat file only) but i dont like that, anyway
but the extern "C"{} - stuff is true
maybe someone has a better solution?
but anyway, what features of C++ can i use(what about templates, classes, inheritance... and what about the standard-libaries )
#6
Posted 23 June 2009 - 08:12 AM
So you have to use extern "C" {}.. ahh ..
AFAIK ... I don't know about what features you can use.. I don't really know what templates are, lol! Guess I'll need to brush up on my C++ before I write a nice app for the fx-9860..
#7
Posted 23 June 2009 - 08:29 AM
[codebox]extern "C"
{
#include "fxlib.h"
template<class T>
class PAIR
{
public:
T first;
T second;
};
...[/codebox]
but the compiler returns an error:
This declaration may not have extern "C" linkage
i guess this is because of the extern "C"{} - solution... is there maybe another way?
pls help
#8
Posted 23 June 2009 - 08:34 AM
Try to include headers before the extern keyword:ive just tried to devclare a simple template class:...pls help
#include "fxlib.h"
extern "C"
{
template<class T>
...
#9
Posted 23 June 2009 - 08:37 AM
#10
Posted 23 June 2009 - 10:39 AM
Oh it's the opposite way:i forgot to tell you that the error is about the "template<class T>" line...
This should work (I hope):
extern "C"
{
#include "fxlib.h"
}
template<class T>
...
so only the includes are in extern "C" block
#11
Posted 24 June 2009 - 08:59 AM
#12
Posted 26 June 2009 - 10:33 AM
unfortunately the addin_main()-function needs extern "C", so i have to use
[codebox]
extern "C"
{
// includes
}
//C++ stuff + a fake main()-function if i want to use c++ in the main function
extern "C"
{
addin_main()
{
fake main();
}
}[/codebox]
but i think thats worth it
thx for your help
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users