IceE DLL on PDA -> Signature necessary?

in Help Center
Does anyone have experience with IceE on PDAs and Securitiy Problems? Is a Signature necessary to make a DLL with Ice-Code work?
I can install a DLL with a simple function-call on the PDA and use it. But when I want to use my Ice-DLL, I always get an error when I want to start the application that uses it.
thanks,
Susanne
I can install a DLL with a simple function-call on the PDA and use it. But when I want to use my Ice-DLL, I always get an error when I want to start the application that uses it.
thanks,
Susanne
0
Comments
I expect the issue you are having is that the MS C++ runtime cannot be found. I would suggest that you build your application statically, including linking the C++ runtime statically. In order to do this you need to edit cppe/config/Make.rules.mak and uncomment the following two lines and then rebuild.
You will now only have to copy the .exe to your PDA to run the Ice application. If you are not placing multiple Ice applications on your PDA then this will also reduce the amount of space your application will take up on the PDA.
int status = 0;
int argc = 0;
char* args[1];
Ice::CommunicatorPtr ic;
ApplicationLayerFunctionsPrx finder;
try {
ic = Ice::initialize(argc, (char**)args);
Ice::ObjectPrx base = ic->stringToProxy("ApplicationLayer:tcp -h 127.0.0.1 -p 1234");
finder = ApplicationLayerFunctionsPrx::checkedCast(base);
if (!finder) {
throw "Invalid proxy";}
}
What could be the cause?
Thank's for your help!
Susanne
In your example, you report that checkedCast() is returning null. This would indicate that the checkedCast was able to contact a server, but the object type was not the expected type. For other failures, checkedCast should throw an exception. You should make sure you are running the correct server.
I assume you are running both the client and server on the PDA since you are using 127.0.0.1 as the host. Perhaps you should start by first just running the client on the PDA and the server on another host. You will have to change the host setting in your proxy string appropriately of course for this to work.
The server is running the same way as on the desktop-PC.
The code on the server-side is the following:
ic = Ice.Util.initialize(args);
Ice.ObjectAdapter adapterAppLayer = ic.createObjectAdapterWithEndpoints(
"ApplicationLayerAdapter", "tcp -h 127.0.0.1 -p 1234");
Ice.Object object = new ApplicationLayerFunctionsI();
adapterAppLayer.add(object, ic.stringToIdentity("ApplicationLayer"));
so port, IP and Identifier are correct.
What do you mean when you say the object type was not the expected type?
Even though you need both running on the PDA in the end, it might still help with debugging your issue to just try the client first from the PDA.
ApplicationLayerFunctionsPrx::checkedCast returning null should indicate the the specified object was not actually a ApplicationLayerFunctions. Having said that, I don't really see how that could be happening in your example.
Again, I suggest first trying the demos/tests that come with Ice-E and make sure that they work. Also I recommend building statically like I mentioned before so we can be sure DLLs are not posing any problems.
The errors are the following:
1>VerbindungsManager.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""__declspec(dllimport) class IceInternal::Handle<class Ice::Communicator> __cdecl Ice::initialize(int &,char * * const,struct Ice::InitializationData const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected])".
1>iceec_static.lib(Transceiver.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "send".
1>iceec_static.lib(Transceiver.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "recv".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "accept".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getnameinfo".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "listen".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getsockopt".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "closesocket".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSASetLastError".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "freeaddrinfo".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "socket".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "bind".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "setsockopt".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getsockname".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "ntohs".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "htons".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAGetLastError".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getaddrinfo".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "htonl".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "connect".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAIoctl".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "ioctlsocket".
1>iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getpeername".
1>iceec_static.lib(Instance.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSACleanup".
1>iceec_static.lib(Instance.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAStartup".
1>iceec_static.lib(ThreadPool.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "select".
1>Windows Mobile 6 Professional SDK (ARMV4I)\Release/DLLJAVAPORTMOBILELIB.dll : fatal error LNK1120: 26 nicht aufgelöste externe Verweise.
1>Das Buildprotokoll wurde unter "file://c:\Dokumente und Einstellungen\user\Eigene Dateien\Visual Studio 2005\Projects\DLLJAVAPORTMOBILELIB\DLLJAVAPORTMOBILELIB\Windows Mobile 6 Professional SDK (ARMV4I)\Release\BuildLog.htm" gespeichert.
1>DLLJAVAPORTMOBILELIB - 28 Fehler, 0 Warnung(en)
========== Alles neu erstellen: 0 erfolgreich, Fehler bei 1, 0 übersprungen ==========
Thank you very much for always replying so fast and for your patience.
Susanne
What could be the cause of the linker-errors below?
DLLJAVAPORTMOBILE.lib(VerbindungsManager.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""__declspec(dllimport) class IceInternal::Handle __cdecl Ice::initialize(int &,char * * const,struct Ice::InitializationData const &,int)" ([email protected]@@[email protected]@[email protected]@[email protected])".
Windows Mobile 6 Professional SDK (ARMV4I)\Release\DLLTestanwendungMobile.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
The error doesn't occur, when I compile my library, but when I compile the Application that links my static library.
After looking at this a bit closer, we believe this linker error comes from a missing macro definition when you build your code and link with the static library version of Ice-E.
You must define the ICEE_STATIC_LIBS macro in the preprocessor definitions. In Visual Studio, you can add this macro by opening the project properties dialog and select "Configuration Properties -> C/C++ -> Preprocessor", in the "Preprocessor Definitions" field, add "ICEE_STATIC_LIBS".
With this macro, the Ice-E headers won't use __declspec(dllimport) for Ice-E symbols and this should fix your linker errors.
Documentation for this macro seems to unfortunately be missing, we'll fix this for the next release!
Cheers,
Benoit.
Bibliothek "Windows Mobile 6 Professional SDK (ARMV4I)\Release/DLLJAVAPORTMOBILELIB.lib" und Objekt "Windows Mobile 6 Professional SDK (ARMV4I)\Release/DLLJAVAPORTMOBILELIB.exp" werden erstellt.
iceec_static.lib(Instance.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSACleanup".
iceec_static.lib(Instance.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAGetLastError".
iceec_static.lib(Instance.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAStartup".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "accept".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getnameinfo".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "listen".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getsockopt".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "closesocket".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSASetLastError".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "freeaddrinfo".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "socket".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "bind".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "setsockopt".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getsockname".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "ntohs".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "htons".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getaddrinfo".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "htonl".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "connect".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "WSAIoctl".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "ioctlsocket".
iceec_static.lib(Network.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "getpeername".
iceec_static.lib(ThreadPool.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "send".
iceec_static.lib(ThreadPool.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "recv".
iceec_static.lib(ThreadPool.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "select".
Windows Mobile 6 Professional SDK (ARMV4I)\Release/DLLJAVAPORTMOBILELIB.dll : fatal error LNK1120: 25 nicht aufgelöste externe Verweise.
To get the right compiler settings, I recommend taking a look at our demos. You can open the demo_CE visual studio solution which is is included with your Ice-E distribution in the cppe\demo directory and compare the project settings with yours. Our demo projects have four different configurations: Debug, Release, DebugStatic, ReleaseStatic, make sure to pick the right one.
Here, I suspect you need to add some more libraries (most likely "ws2.lib") into the "Additional Dependencies" field in "Configuration Properties->Linker->Options" of your project properties.
Cheers,
Benoit.