http://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252015-09-08T12:07:18ZRedmineWt - Support #4424: (boost:: && std::) bind of Wt::WApplication* application_creator fails with too few argumentshttp://redmine.emweb.be/issues/4424?journal_id=128972015-09-08T12:07:18ZBenoit Daccachebenoit@emweb.be
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Support</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li></ul><p>Hey Markus,</p>
<p>If application_creator is not a static method your bind should take the instance of the class:<br><br>
eg.<br><br>
Wt::WRun(argc, argv,std::bind(&MDDB_Service::application_creator,mddb_instance_pointer, std::placeholders::_1, 5));</p>
<p>Otherwise your bind is maybe missing an '&' before the MDDB_SERVICE:<br><br>
Wt::WRun(argc, argv,std::bind(&MDDB_Service::application_creator,mddb_instance_pointer, std::placeholders::_1, 5));</p>
<p>The instance to WEnvironment will be passed by WRun to the bound function/method, so the visibility of the constructor is not the problem here.</p>
<p>Exemple of working code:<br><br>
@<br><br>
WApplication *createApplication(const WEnvironment& env, int i)<br><br>
{<br><br>
return new Test(env);<br><br>
}</p>
<p>int main(int argc, char **argv)<br><br>
{<br><br>
return WRun(argc, argv, std::bind(&createApplication, std::placeholders::_1, 1));<br><br>
}</p>
<p>@</p>
<p>Benoit</p>
Wt - Support #4424: (boost:: && std::) bind of Wt::WApplication* application_creator fails with too few argumentshttp://redmine.emweb.be/issues/4424?journal_id=129052015-09-08T12:49:54ZMarkus Klemm
<ul></ul><p>Benoit Daccache wrote: </p>
<blockquote>
<p>If application_creator is not a static method your bind should take the instance of the class:<br><br>
No MDDB_Service is just a namespace, it wasn't a member function /method. And the &operator didn't make a difference.<br><br>
Anyway:</p>
</blockquote>
<p>I was able to reproduce it with your code</p>
<p>@<br><br>
Wt::WApplication *createApplication(const Wt::WEnvironment& env, int i) {<br><br>
return new Wt::WApplication(env);<br><br>
}</p>
<p>int main(int argc, char argv)<br><br>
{<br><br>
Wt::WRun(argc, argv,std::bind(&createApplication, std::placeholders::_1, 1));<br><br>
}<br><br>
@<br><br>
Full file and boost snippet error refers to: <a href="https://gist.github.com/Superlokkus/fac974528a3831adf165" class="external">https://gist.github.com/Superlokkus/fac974528a3831adf165</a></p>
<p>Error: Error 94 error C2198: 'Wt::WApplication *(__cdecl *)(const Wt::WEnvironment &,int)' : too few arguments for call c:\users\klm\downloads\wt-3.3.4-msvs2013-windows-x86-sdk\include\boost\function\function_template.hpp 95 1 MDDB_Web</p>
<p>BTW: I use your prebuilt binary (with the included boost library).</p>
Wt - Support #4424: (boost:: && std::) bind of Wt::WApplication* application_creator fails with too few argumentshttp://redmine.emweb.be/issues/4424?journal_id=129142015-09-09T08:10:21ZWim Dumonwim@emweb.be
<ul></ul><p>Hello,</p>
<p>Your example compiles on my Windows installation on msvs 2013. Granted, I didn't try with our prebuild binaries, but my development setup your code works. It may have been a problem in boost that's solved in the meantime?</p>
<p>BR,<br><br>
Wim.</p>
Wt - Support #4424: (boost:: && std::) bind of Wt::WApplication* application_creator fails with too few argumentshttp://redmine.emweb.be/issues/4424?journal_id=129172015-09-09T08:41:33ZMarkus Klemm
<ul></ul><p>Wim Dumon wrote:</p>
<blockquote>
<p>It may have been a problem in boost that's solved in the meantime?</p>
</blockquote>
<p>I guess, I'm only using this boost version and msvs 2013 at all, because building Wt is a pain in <strong>*</strong>*, because of the build system of the dependencies.<br><br>
In the other hand I could be less a official problem of boost, but of msvs 2013, caused by it's limited C++11 support.</p>
<p>Could anyone help me out with a Wt build for MSVS 2015 x64 please, with the full pdf and raster support? I suppose for the sake of compatibility the built packages should be updated anyway.</p>
Wt - Support #4424: (boost:: && std::) bind of Wt::WApplication* application_creator fails with too few argumentshttp://redmine.emweb.be/issues/4424?journal_id=129242015-09-09T17:11:47ZWim Dumonwim@emweb.be
<ul></ul><p>Next release will most likely have a msvc2015 build too. However I already noticed not all dependencies compile well with msvs 2015...</p>
<p>Wim.</p>