Hi All

I'm developing my own logger project.I wish it to be an external .dll file added to other project,without need of compilation or somesuch.
I've created some test project,added logger.lib to linker libs,copied logger.dll into my test project-but it does not work when I try to use one of my macros :/
What else shoud be done to make it work?To use QLibrary::resolve()?

Below my header files:
Qt Code:
  1. #ifndef LOGGER_GLOBAL_H
  2. #define LOGGER_GLOBAL_H
  3.  
  4. #include <Qt/qglobal.h>
  5.  
  6. #define maxLevel 4
  7.  
  8. #ifdef LOGGER_LIB
  9. # define LOGGER_EXPORT Q_DECL_EXPORT
  10. #else
  11. # define LOGGER_EXPORT Q_DECL_IMPORT
  12. #endif
  13.  
  14. #define LOGDEBUG_Logger(text,loggerId,level) Logger::printLog(text,loggerId,__LINE__,__FILE__,level);
  15. #define LOGDEBUG_Level(text,level) LOGDEBUG_LOGGER(text,"default",level)
  16. #define LOGDEBUG(text) LOGDEBUG_Logger(text,"default",maxLevel)
  17.  
  18. #endif // LOGGER_GLOBAL_H
To copy to clipboard, switch view to plain text mode 

and logger.h file:
Qt Code:
  1. #ifndef LOGGER_H
  2. #define LOGGER_H
  3.  
  4. #include <QMap>
  5. #include <QObject>
  6. #include "logger_global.h"
  7. #include "logwindow.h"
  8.  
  9. LOGGER_EXPORT enum LogMode
  10. {
  11. None=0,
  12. Window,
  13. File,
  14. WindowAndFile
  15. };
  16.  
  17. class LoggerObject;
  18. class LOGGER_EXPORT Logger : public QObject
  19. {
  20. QMap<QString,LoggerObject*> loggers;
  21. static Logger *instance;
  22. LoggerObject *defaultLogger;//for convience and to avoid getting it from the map all the time
  23.  
  24. static inline bool createManager(void);
  25. Logger(QObject *parent=0);
  26.  
  27. public:
  28. static LoggerObject* getLoggerObject(const QString &id);
  29. static void printLog(const QString &text,const QString &loggerID,int line=0,const QString &file=QString(),char level=maxLevel,char type=0);
  30.  
  31. virtual ~Logger(void);
  32. };
  33.  
  34. class LOGGER_EXPORT LoggerObject : public QObject
  35. {
  36. friend class Logger;
  37.  
  38. QList<LogData> logs;//contains log messages.Filled by Logger::printLog()
  39.  
  40. QString id;//identifier of logger in Logger::loggers map
  41. LogMode mode;//determines where the logs shoud be put in
  42. QString logFile;//name and path of the log file
  43. LogWindow *logWindow;
  44.  
  45. void printLog(const QString &text,int line=0,const QString &file=QString(),char level=maxLevel,char type=0);
  46. LoggerObject(const QString &id,QObject *parent)
  47. :QObject(parent),id(id),logFile(id+".log.xml"),mode(Window)
  48. {};
  49.  
  50. public:
  51. QString identifier(void);
  52. void setLogMode(LogMode mode);
  53. LogMode logMode(void);
  54. void setLogFile(const QString &filename);
  55. QString logFileName(void);
  56.  
  57. //co jeszcze trzeba
  58. };
  59. #endif // LOGGER_H
To copy to clipboard, switch view to plain text mode