Archived

This forum has been archived. Please start a new discussion on GitHub.

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(24): 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!

Comments

  • Mmmmmm I forgot to say that when I compile client project independently it compiles correctly.:confused:
  • xdm
    xdm La Coruña, Spain
    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
  • 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".
  • xdm
    xdm La Coruña, Spain
    Hi,

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

    Regards,
    Jose
  • 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.
  • 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 !
  • xdm
    xdm La Coruña, Spain
    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:
    #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.
  • 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
    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
    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
    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 :mad:
  • Solved ! :)