Results 1 to 10 of 10

Thread: Export DLL. No such file.

  1. #1
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15

    Export DLL. No such file.

    Hi,

    I've a VS2010 solution within 3 projects.
    Two of them are the client and server of an Ice solution, with an auto-generated .cpp and .h from Slice compilation. Those projects generate two DLL's wich are used in the third project (Main).

    But when I import them, there is an error in file Imagen.h (generated from Imagen.ice Slice file).
    It can't find the directory of Ice headers.

    This is the error 3>c:\users\...\proyecto\cliente\cliente\Imagen.h(2 4): fatal error C1083: No se puede abrir el archivo incluir: 'Ice/LocalObjectF.h': No such file or directory

    The properties are the same both client and server project. Include directories, libs, etc.
    Client can't compile while server does. Ice is enabled in client and server projects, but isn't in Main project because it generates more errors and I think isn't necessary, there I'm just calling functions from DLL's.

    Any idea?

    Thanks!

  2. #2
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    Mmmmmm I forgot to say that when I compile client project independently it compiles correctly.

  3. #3
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruña, Spain
    Posts
    588
    Hi Carlos,

    Isn't clear where this error come from, it seems that your "Main" project include "Image.h" ? and that it doesn't found Ice headers? if that is the case you must enable "Slice builder" in "Main" project and doing so the plug-in will add Ice library and header directories to your project.

    What other errors do you see when you enabled "Slice builder" in "Main" project?

    Bests regards,
    Jose

  4. #4
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    Hi again,

    I have Imagen.ice in project Client and Server. It compiles automatically in both projects and generates .cpp and .h
    Then generates 2 DLL's, Client.dll and Server.dll to be used by Main project. Here I don't need Imagen.h because I'm calling functions from dll's.

    If I enable Slice compiler in Main project all errors are "new definition of class".

  5. #5
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruña, Spain
    Posts
    588
    Hi,

    Can you attach a demo project that reproduce your problem? I will take a look at it.

    Regards,
    Jose

  6. #6
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    Hi again !

    It seems it has been solved. The Ice directory was wrongly typed in Additional directories include in Main project.

    But now I have many other errors. All of these are "new definitions of class" in one of the Imagen.h files.
    Each project (client and server) must have a Imagen.h file and when I export them to the Main project it seems its duplicated.

  7. #7
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    The question is ... how can I include both project directories excluding one of the Imagen.h from one project.
    In Cliente directory there are:
    Imagen.cpp, Imagen.h, Imagen.ice, Cliente.h, Cliente.cpp
    In Servidor directory:
    Imagen.cpp, Imagen.h, Imagen.ice, Servidor.h, Servidor.cpp

    I want, e.g, to include just Cliente.h, Cliente.cpp from Cliente and include all files from Servidor.

    Thanks !

  8. #8
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruña, Spain
    Posts
    588
    I'm not sure why you are getting this problems with includes the generated header guards should handle that, the generated Image.h files should have an header guard like:
    Code:
    #ifndef __Image_h__
    #define __Image_h__
    If you use different "--include-dir" options for compiling client/server Image.ice this will not work.


    See also How do I use slice2cpp

    Note that loading Client Server dlls in main Project will in general not work. As Client and Server projects define same generated classes and that will cause problems, in that case will be better to put common classes in a Common.dll that both projects use.

  9. #9
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    I've implement both client and server in the same project and I've tried to export by different ways. Classic with "__declspec(dllexport)" and ICE with "ICE_DECLSPEC_EXPORT".

    In ICE way I declare this functions
    Code:
    namespace Servidores {
    	class ImagenI : virtual public Proyecto::ImageProvider {
    		public:
    
    			ImageDataPtr* data;
    			ImageDescriptionPtr* descr;
    			bool primeraVez;
    			IplImage* imgAnterior;
    			char* puerto;
    
    			ImagenI(char puerto[]);
    
    			virtual Proyecto::ImageDataPtr getImageData(const Ice::Current& c);
    
    			virtual Proyecto::ImageDescriptionPtr getImageDescription(const Ice::Current& c);
    
    			virtual void sendImageData(const Proyecto::ImageDataPtr& im, const Ice::Current& c);
    
    			virtual void sendImageDescription(const Proyecto::ImageDescriptionPtr& im, const Ice::Current& c);
    
    			void pasaParam(const string& s, const Ice::Current&);
    
    			IplImage* restaImagenes(IplImage* imgActual);
    
    			ICE_DECLSPEC_EXPORT int run(char puerto[]);
    	};
    
    	class ServThreads : public IceUtil::Thread{
    			public:
    		
    				ServThreads(char type[], char port[]);
    
    				virtual void run();
    	};
    
    	ICE_DECLSPEC_EXPORT int main(int argc, char *argv[]);
    }
    and it compiles and creates well .dll and .lib files.

    But when I compile Main project using dll file, it returns many errors like those
    Code:
    Error	5	error LNK2001: símbolo externo "__declspec(dllimport) public: virtual __thiscall Ice::AdapterNotFoundException::~AdapterNotFoundException(void)" (__imp_??1AdapterNotFoundException@Ice@@UAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	7	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall IceInternal::FactoryTableInit::FactoryTableInit(void)" (__imp_??0FactoryTableInit@IceInternal@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	6	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall IceInternal::FactoryTableInit::~FactoryTableInit(void)" (__imp_??1FactoryTableInit@IceInternal@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	10	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall Ice::ConnectionInfo::ConnectionInfo(void)" (__imp_??0ConnectionInfo@Ice@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	8	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall Ice::AdapterNotFoundException::AdapterNotFoundException(void)" (__imp_??0AdapterNotFoundException@Ice@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	9	error LNK2001: símbolo externo "__declspec(dllimport) protected: void __thiscall Ice::ConnectionInfo::`vbase destructor'(void)" (__imp_??_DConnectionInfo@Ice@@IAEXXZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	11	error LNK1120: 6 externos sin resolver	C:\Users\Cal30\Desktop\Proyecto\Servidor\Prueba\Main.exe
    If I use _declspec(dllexport) instead of ICE errors are the same
    Code:
    Error	5	error LNK2001: símbolo externo "__declspec(dllimport) public: virtual __thiscall Ice::AdapterNotFoundException::~AdapterNotFoundException(void)" (__imp_??1AdapterNotFoundException@Ice@@UAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	7	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall IceInternal::FactoryTableInit::FactoryTableInit(void)" (__imp_??0FactoryTableInit@IceInternal@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	6	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall IceInternal::FactoryTableInit::~FactoryTableInit(void)" (__imp_??1FactoryTableInit@IceInternal@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	10	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall Ice::ConnectionInfo::ConnectionInfo(void)" (__imp_??0ConnectionInfo@Ice@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	8	error LNK2001: símbolo externo "__declspec(dllimport) public: __thiscall Ice::AdapterNotFoundException::AdapterNotFoundException(void)" (__imp_??0AdapterNotFoundException@Ice@@QAE@XZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    Error	9	error LNK2001: símbolo externo "__declspec(dllimport) protected: void __thiscall Ice::ConnectionInfo::`vbase destructor'(void)" (__imp_??_DConnectionInfo@Ice@@IAEXXZ) sin resolver	C:\Users\Cal30\Desktop\Proyecto\Main\Main\Main.obj
    I don't know what can I do and I'm fighting with this for a month

  10. #10
    Cal30 is offline Registered User
    Name: Carlos Calatayud
    Organization: Universidad Castilla-La Mancha
    Project: Surveillance Communications
    Join Date
    Jul 2011
    Posts
    15
    Solved !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 01-12-2011, 03:51 AM
  2. use ice in dll?
    By cool stone in forum Help Center
    Replies: 4
    Last Post: 05-23-2007, 06:52 AM
  3. Replies: 3
    Last Post: 05-02-2007, 09:51 AM
  4. slice2cpp --dll-export error
    By xdm in forum Bug Reports
    Replies: 1
    Last Post: 11-06-2006, 08:37 AM
  5. ICE should export C++ API for TCP/UDP
    By dragzhb in forum Comments
    Replies: 9
    Last Post: 10-28-2004, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •