IceE DLL on PDA -> Signature necessary?

susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
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

Comments

  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    No it should not be necessary to sign the Ice-E DLL. What is the error that you are seeing? What platform is this on?

    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
    #STATICLIBS             = yes
    #STATIC_CPP_RUNTIME     = yes
    
    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.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    The DLL works meanwhile, but I still have the Problem, that I get an invalid Proxy Error on the PDA I don't get on the desktop-PC. Are there any configuration-settings I have to make on the PDA(Windows Mobile 6)? This is the code:

    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";}
    }
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    I'm giving the initialize-method the right path to the application plus the name of exe-file plus ".exe" now.Unfurtunately, I still get the same error.
    What could be the cause?
    Thank's for your help!

    Susanne
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    Have you tried running the demos/tests that come with Ice-E? If not I would suggest that you try these first and make sure they work.

    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.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    The problem is, that both, the client and the server have to run on one PDA. The connection is just there to hand over function calls from old Applications to a DLL to an OSGI-Framework.
    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?
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    susannesch wrote: »
    The problem is, that both, the client and the server have to run on one PDA. The connection is just there to hand over function calls from old Applications to a DLL to an OSGI-Framework.

    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.
    susannesch wrote: »
    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?

    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.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    Okay, thanks. I'll build the whole thing again. Maybe this is really the problem because the application crashes when I try to set InitProperties like in the examples (initData.properties->setProperty("ApplicationLayerFunctions.Proxy", "ApplicationLayer:tcp -h 127.0.0.1 -p 1234");)
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    I've linked the static lib, but when I do that, I get 28 Errors (unresolved external symbols). Did I make a mistake? I've linked iceec_static.lib, because I'm using ICEE_PURE_CLIENT
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    What are the exact errors? Does using icee_static.lib instead fix them? If all your application source files are compiled with ICEE_PURE_CLIENT and do not use any server functionality then you should be able to use iceec_static.lib.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    using icee_static.lib doesn't fix the errors. I also chose STATIC_CPP_RUNTIME.
    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])&quot;.
    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 ==========
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    I solved the problem! I had to compile my own lib that uses the Ice-lib as static lib, too.
    Thank you very much for always replying so fast and for your patience.

    Susanne
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    Unfortunately, the Problem isn't solved. My Application can't find my exportet Symbol anymore, since I made my DLL a static lib.
    What could be the cause of the linker-errors below?
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    Ok, now I've got only 3 errors left:

    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])&quot;.
    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.
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    Are you linking your application with the Ice-E library as well? If not, you could try that.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Susanne,

    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.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    Defining the Macro reduced the errors a little bit, thanks. I don't want to make my DLL a static lib, so there are 25 of the 28 Errors mentioned below left. It is strange that these Errors all have to do with sockets and networking.

    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.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Susanne,

    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.
  • susanneschsusannesch Member Susanne SchillingOrganization: HydrometerProject: accessing an OSGI Framework from C++ ✭✭
    That's it, the ws2.lib! Thanks!
Sign In or Register to comment.