[solved] OpenLibrary with error 87 : Parameter incorrect

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
rover_klaus
Kobold
Posts: 25
Joined: Fri Jun 27, 2008 12:14 am

[solved] OpenLibrary with error 87 : Parameter incorrect

Post by rover_klaus » Sat Nov 05, 2011 1:02 pm

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 the 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)

And now! Not only the DLL using CEGUI, but several other dlls of my projects are having this problem!

Can anyone help me with this?
Last edited by rover_klaus on Sun Nov 06, 2011 10:57 am, edited 1 time in total.
0 x

rover_klaus
Kobold
Posts: 25
Joined: Fri Jun 27, 2008 12:14 am

Re: OpenLibrary with error 87 : Parameter incorrect

Post by rover_klaus » Sun Nov 06, 2011 10:56 am

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.
0 x

paulm123
Gnoblar
Posts: 2
Joined: Mon Jan 18, 2016 4:09 am

Re: [solved] OpenLibrary with error 87 : Parameter incorrect

Post by paulm123 » Mon Jan 18, 2016 4:20 am

thanx rover_klaus!
i tryng for days to understand why some plugins dont run when compiled with vc10.You tip solved the problem :D !
0 x

Post Reply