Page 1 of 1

[solved] Windows Error 87 : Parameter incorrect

Posted: Fri Nov 04, 2011 20:21
by klaus
Hi all,

The weirdest thing happened in my life! I use CEGUI in a dll plugin for another project. After I upgraded my visual studio from 2008 to 2010, I can't run my project! just when I load the plugin dll with LoadLibrary, error 87 pops up and tells me: The parameter is incorrect. I have googled the web for about a week, yet I have not found a working solution for it.
The error rises exactly in the OpenLibrary function, which is completely for windows, and I don't pass any parameter to the function. (The function takes only the address for the module to be loaded, nothing extra)

Can anyone help me with this?

Re: Windows Error 87 : Parameter incorrect

Posted: Sat Nov 05, 2011 18:02
by CrazyEddie
Did you rebuild everything with the new compiler? And made sure that any prebuilt components are also using the same compiler?

I don't really know if the above would work, since I have no details about what you're doing. I don't develop on windows these days, but know that it's real finicky about everything matching up as regards to compilers and such.

CE.

Re: Windows Error 87 : Parameter incorrect

Posted: Sat Nov 05, 2011 18:52
by klaus
Hi CE!

I deleted EVERYTHING, checked the project out from SVN and rebuild it. I work on Windows 7 with VS2010 (without SP1) and I'm using CEGUI 0.7.5 SDK originally from this website. The closest solution I have found to my problem is that one or more of these components use different versions of VC runtime: My project, the DLL plugin, CEGUI. Since there is no difference in compiler flags for the project and the plugin, can I ask you what C runtime version are you compiling the windows SDK with?

Thanks in advance :)

Re: Windows Error 87 : Parameter incorrect

Posted: Sun Nov 06, 2011 09:54
by klaus
Finally... I found the reason. I don't excatly know why, but it is definitely related to this option:
In the linker section of the DLL configuration there is an option, named "Link time code generation"
If this option is not set to: Yes (which adds the parameter "/LTCG" to the linker parameters) the problem will arise.
The problem is not related to CEGUI of even standard C++. It is a visual studio specific problem.

Thanks again :)

Re: [solved] Windows Error 87 : Parameter incorrect

Posted: Sun Nov 06, 2011 16:44
by CrazyEddie
I don't think I've ever heard of that. Thanks for posting the resolution to the issue.

CE.