0

I need to make gui application that must call c++ dll class functions. What programming languages are able to call class functions without problems? By problems I mean wrappers and similar things.

vico
  • 17,051
  • 45
  • 159
  • 315
  • 1
    You cannot be sure even in case of C++ with same compiler but different compiler options. So, if you're not 100% sure that your dynamic library and caller will be compiled with same compiler and same options, same STL implementation etc., and you're not looking for troubles, use good old `extern "C"` factory or [COM](http://en.wikipedia.org/wiki/Component_Object_Model)-like things ;) – Ivan Aksamentov - Drop Feb 28 '14 at 16:04
  • [Don't export C++ objects in a DLL](http://stackoverflow.com/questions/12314101/creating-c-dll-without-static-methods/12314276#12314276) – tenfour Feb 28 '14 at 16:28

2 Answers2

0

Why you don't make the GUI directly in c++? QT is a well known and mature framework, for instance

Silyus
  • 19
  • 1
0

C functions in a DLL can be called from most languages.

C++ functions, particularly with classes are difficult at best. Probably they will cause you more trouble than it is worth.

My advice is to just use C++ and prevent the problems.

If you insist on building your GUI with another language X, then your best approach would be to write a glue DLL, written in C++, that shows a C-only interface to the X-GUI and accesses the target C++ classes directly.

rodrigo
  • 94,151
  • 12
  • 143
  • 190