Re: [OBORONA-SPAM] Re: Gtk::Module



>>>>> "Alexander" == Alexander Volosatov <rope-walker yandex ru> writes:

>>> Try this: Glib::Module module("libfsdyn.dll");
  
>>> if (module) { void (*function)(void); cout << "Module found\n";
>>> module.get_symbol("func1", function); (*function)();
>>> }


>>> Bob

>> It doesn't work.

Alexander> Code of lib:

Alexander> #include <iostream>

Alexander> void func1() { std::cout << "dll func\n";
Alexander> }

Alexander> WHY FUNCTION IS NOT FOUND????

C++ compiler mangles function names thus you have to use C linkage for
functions your library exports:

extern "C" void func1() { bla-bla-bla }

-- 
WBR,
Max Vasin.

NP: /home/max/Music/Therion/Secret of the Runes/05.Schwarzalbenheim_(Svartalfheim).flac




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]