Discussion:
Building WinCE Library
(too old to reply)
Richard
2011-11-20 17:54:29 UTC
Permalink
Hello. I'm building a winCE library in eVC4SP4. The library contains a class that does not call any Win32 or MFC functions. However, when I link this lib to the winCE app that I'm building, it compiles fine, but I get a Win32 error 126 (module not found) when I try to run it in the device emulator. If I remove the class instantiation from the app, the program runs fine in the emulator. So I know that the problem is with my library, but I don't know what is wrong with it.

I did have to add __declspec(dllexport) to the class definition in the library. Without it, all of the class member functions were discarded by the linker. Seems kind of strange to me that I needed to do this (I built this library originally in winXP and I didn't need to add __declspec(dllexport) to use the library in an XP app). Why/how is the dll exporting different in CE?

Can someone help me out here? I don't know what else to do to debug the error 126 from the emulator?
Charlie
2011-11-21 21:22:56 UTC
Permalink
Post by Richard
Hello. I'm building a winCE library in eVC4SP4. The library contains a class that does not call any Win32 or MFC functions. However, when I link this lib to the winCE app that I'm building, it compiles fine, but I get a Win32 error 126 (module not found) when I try to run it in the device emulator. If I remove the class instantiation from the app, the program runs fine in the emulator. So I know that the problem is with my library, but I don't know what is wrong with it.
I did have to add __declspec(dllexport) to the class definition in the library. Without it, all of the class member functions were discarded by the linker. Seems kind of strange to me that I needed to do this (I built this library originally in winXP and I didn't need to add __declspec(dllexport) to use the library in an XP app). Why/how is the dll exporting different in CE?
Can someone help me out here? I don't know what else to do to debug the error 126 from the emulator?
Hello. I'm building a winCE library in eVC4SP4. The library contains a class that does not call any Win32 or MFC functions. However, when I link this lib to the winCE app that I'm building, it compiles fine, but I get a Win32 error 126 (module not found) when I try to run it in the device emulator. If I remove the class instantiation from the app, the program runs fine in the emulator. So I know that the problem is with my library, but I don't know what is wrong with it.
I did have to add __declspec(dllexport) to the class definition in the library. Without it, all of the class member functions were discarded by the linker. Seems kind of strange to me that I needed to do this (I built this library originally in winXP and I didn't need to add __declspec(dllexport) to use the library in an XP app). Why/how is the dll exporting different in CE?
Can someone help me out here? I don't know what else to do to debug the error 126 from the emulator?
Richard,

Error 126 is the classic "I cannot find a dll" error - as you are
aware. Since you are using the simulator (I've not ever used it),
perhaps the simulated target is an x86? If so, one trick I use is to
use the "depends" tool on the executable you've built. It might show
you exactly what is wrong.

Regards,

C. gilley

ps

The usenet groups are pretty dead for general development questions
such as you are asking. Microsoft about a year ago elected to pull it
over to their site.

Loading...