Results 1 to 4 of 4

Thread: compilation error for CLFS file in qt

  1. #1
    Join Date
    Oct 2014
    Posts
    71
    Thanks
    13
    Qt products
    Qt5
    Platforms
    Windows

    Question compilation error for CLFS file in qt

    Hello
    I have a log4cxx project in visual studio which is running perfectly but i want to comple the same project in Qt Creator, so i included .h file and .cpp in my Qt Project below is my .pro file
    Qt Code:
    1. QT += core gui
    2.  
    3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    4.  
    5. TARGET = Debugging
    6. TEMPLATE = app
    7. #QMAKE_CFLAGS = -nologo -Zc:wchar_t- -WChar_t
    8. DEFINES -= UNICODE
    9. DEFINES += WIN32
    10. DEFINES += INSIDE_LOG4CPLUS
    11. DEFINES += _WIN32_WINNT=0x0501
    12. DEFINES += WINVER=0x0501
    13. DEFINES += NTDDI_VERSION=0x05010200
    14. DEFINES += _SCL_SECURE_NO_DEPRECATE
    15. DEFINES += _CRT_SECURE_NO_DEPRECATE
    16. DEFINES += _CRT_SECURE_NO_WARNINGS
    17. DEFINES += _WINSOCK_DEPRECATED_NO_WARNINGS
    18. INCLUDEPATH += C:/Practice_Program/Debugging/include
    19. ISTFILES += C:/Practice_Program/Debugging/Log4Cxx/bin.Debug/log4cplusD.lib
    20. #win32: LIBS += -L$$C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86 -lclfsw32.lib
    21.  
    22. SOURCES += main.cpp\
    23. mainwindow.cpp \
    24. loggingserver.cpp \
    25. src/appender.cxx \
    26. src/appenderattachableimpl.cxx \
    27. src/asyncappender.cxx \
    28. src/clfsappender.cxx \
    29. src/clogger.cxx \
    30. src/configurator.cxx \
    31. src/connectorthread.cxx \
    32. src/consoleappender.cxx \
    33. src/cygwin-win32.cxx \
    34. src/env.cxx \
    35. src/factory.cxx \
    36. src/fileappender.cxx \
    37. src/fileinfo.cxx \
    38. src/filter.cxx \
    39. src/global-init.cxx \
    40. src/hierarchy.cxx \
    41. src/hierarchylocker.cxx \
    42. src/layout.cxx \
    43. src/lockfile.cxx \
    44. src/log4judpappender.cxx \
    45. src/logger.cxx \
    46. src/loggerimpl.cxx \
    47. src/loggingevent.cxx \
    48. src/loggingmacros.cxx \
    49. src/loglevel.cxx \
    50. src/loglog.cxx \
    51. src/logloguser.cxx \
    52. src/mdc.cxx \
    53. src/msttsappender.cxx \
    54. src/ndc.cxx \
    55. src/nteventlogappender.cxx \
    56. src/nullappender.cxx \
    57. src/objectregistry.cxx \
    58. src/patternlayout.cxx \
    59. src/pointer.cxx \
    60. src/property.cxx \
    61. src/queue.cxx \
    62. src/rootlogger.cxx \
    63. src/sleep.cxx \
    64. src/snprintf.cxx \
    65. src/socket-unix.cxx \
    66. src/socket-win32.cxx \
    67. src/socket.cxx \
    68. src/socketappender.cxx \
    69. src/socketbuffer.cxx \
    70. src/stringhelper-clocale.cxx \
    71. src/stringhelper-cxxlocale.cxx \
    72. src/stringhelper-iconv.cxx \
    73. src/stringhelper.cxx \
    74. src/syncprims.cxx \
    75. src/syslogappender.cxx \
    76. src/threads.cxx \
    77. src/timehelper.cxx \
    78. src/tls.cxx \
    79. src/version.cxx \
    80. src/win32consoleappender.cxx \
    81. src/win32debugappender.cxx \
    82. debug/moc_loggingserver.cpp \
    83. debug/moc_mainwindow.cpp
    84.  
    85. HEADERS += mainwindow.h \
    86. loggingserver.h \
    87. macros.h \
    88. ui_mainwindow.h \
    89. include/log4cplus/boost/deviceappender.hxx \
    90. include/log4cplus/config/defines.hxx.in \
    91. include/log4cplus/config/macosx.h \
    92. include/log4cplus/config/win32.h \
    93. include/log4cplus/config/windowsh-inc.h \
    94. include/log4cplus/helpers/appenderattachableimpl.h \
    95. include/log4cplus/helpers/connectorthread.h \
    96. include/log4cplus/helpers/fileinfo.h \
    97. include/log4cplus/helpers/lockfile.h \
    98. include/log4cplus/helpers/loglog.h \
    99. include/log4cplus/helpers/logloguser.h \
    100. include/log4cplus/helpers/pointer.h \
    101. include/log4cplus/helpers/property.h \
    102. include/log4cplus/helpers/queue.h \
    103. include/log4cplus/helpers/sleep.h \
    104. include/log4cplus/helpers/snprintf.h \
    105. include/log4cplus/helpers/socket.h \
    106. include/log4cplus/helpers/socketbuffer.h \
    107. include/log4cplus/helpers/stringhelper.h \
    108. include/log4cplus/helpers/thread-config.h \
    109. include/log4cplus/helpers/timehelper.h \
    110. include/log4cplus/internal/cygwin-win32.h \
    111. include/log4cplus/internal/env.h \
    112. include/log4cplus/internal/internal.h \
    113. include/log4cplus/internal/socket.h \
    114. include/log4cplus/spi/appenderattachable.h \
    115. include/log4cplus/spi/factory.h \
    116. include/log4cplus/spi/filter.h \
    117. include/log4cplus/spi/loggerfactory.h \
    118. include/log4cplus/spi/loggerimpl.h \
    119. include/log4cplus/spi/loggingevent.h \
    120. include/log4cplus/spi/objectregistry.h \
    121. include/log4cplus/spi/rootlogger.h \
    122. include/log4cplus/thread/impl/syncprims-cxx11.h \
    123. include/log4cplus/thread/impl/syncprims-impl.h \
    124. include/log4cplus/thread/impl/syncprims-pmsm.h \
    125. include/log4cplus/thread/impl/syncprims-pthreads.h \
    126. include/log4cplus/thread/impl/syncprims-win32.h \
    127. include/log4cplus/thread/impl/threads-impl.h \
    128. include/log4cplus/thread/impl/tls.h \
    129. include/log4cplus/thread/syncprims-pub-impl.h \
    130. include/log4cplus/thread/syncprims.h \
    131. include/log4cplus/thread/threads.h \
    132. include/log4cplus/appender.h \
    133. include/log4cplus/asyncappender.h \
    134. include/log4cplus/clfsappender.h \
    135. include/log4cplus/clogger.h \
    136. include/log4cplus/config.h.cmake.in \
    137. include/log4cplus/config.h.in \
    138. include/log4cplus/config.hxx \
    139. include/log4cplus/configurator.h \
    140. include/log4cplus/consoleappender.h \
    141. include/log4cplus/fileappender.h \
    142. include/log4cplus/fstreams.h \
    143. include/log4cplus/hierarchy.h \
    144. include/log4cplus/hierarchylocker.h \
    145. include/log4cplus/layout.h \
    146. include/log4cplus/log4judpappender.h \
    147. include/log4cplus/logger.h \
    148. include/log4cplus/loggingmacros.h \
    149. include/log4cplus/loglevel.h \
    150. include/log4cplus/mdc.h \
    151. include/log4cplus/msttsappender.h \
    152. include/log4cplus/ndc.h \
    153. include/log4cplus/nteventlogappender.h \
    154. include/log4cplus/nullappender.h \
    155. include/log4cplus/qt4debugappender.h \
    156. include/log4cplus/qt5debugappender.h \
    157. include/log4cplus/socketappender.h \
    158. include/log4cplus/streams.h \
    159. include/log4cplus/syslogappender.h \
    160. include/log4cplus/tchar.h \
    161. include/log4cplus/tracelogger.h \
    162. include/log4cplus/tstring.h \
    163. include/log4cplus/version.h \
    164. include/log4cplus/win32consoleappender.h \
    165. include/log4cplus/win32debugappender.h \
    166. src/log4cplus.rc.in
    167.  
    168. FORMS += mainwindow.ui
    To copy to clipboard, switch view to plain text mode 
    But during compilation time i am getting the below error
    Qt Code:
    1. C:\Practice_Program\Debugging\src\clfsappender.cxx:130: error: C2065: 'CLFS_MGMT_POLICY' : undeclared identifier
    2. C:\Practice_Program\Debugging\src\clfsappender.cxx:132: error: C2065: 'CLFS_MGMT_POLICY_VERSION' : undeclared identifier
    3. C:\Practice_Program\Debugging\src\clfsappender.cxx:136: error: C2065: 'CLFS_INFORMATION' : undeclared identifier
    4. C:\Practice_Program\Debugging\src\clfsappender.cxx:152: error: C3861: 'RegisterManageableLogClient': identifier not found
    To copy to clipboard, switch view to plain text mode 
    I found that the defination of above variable and macro is in clfsmgmt.h file which is present at C:\Program Files (x86)\Windows Kits\8.1\Include\um directry
    Even i tried adding the include path or liberary in .pro file but still the problem is same but i am not getting any compilation error when trying to build same code in visual studio.
    Can anyone let me know why i am getting such problem.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compilation error for CLFS file in qt

    I found that the defination of above variable and macro is in clfsmgmt.h file which is present at C:\Program Files (x86)\Windows Kits\8.1\Include\um directry
    The pro file you posted is not looking there.

    Even i tried adding the include path or library in .pro file but still the problem is same
    Show your pro file with the added include path.

    Also, are you sure you are using MS environment to build the project and not MinGW?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2014
    Posts
    71
    Thanks
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: compilation error for CLFS file in qt

    Below is my Pro file
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = Debugging
    TEMPLATE = app
    #QMAKE_CFLAGS = -nologo -Zc:wchar_t- -WChar_t
    DEFINES -= UNICODE
    #DEFINES += WIN32
    DEFINES += INSIDE_LOG4CPLUS
    DEFINES += _WIN32_WINNT=0x0501
    DEFINES += WINVER=0x0501
    DEFINES += NTDDI_VERSION=0x05010200
    DEFINES += _SCL_SECURE_NO_DEPRECATE
    DEFINES += _CRT_SECURE_NO_DEPRECATE
    DEFINES += _CRT_SECURE_NO_WARNINGS
    DEFINES += _WINSOCK_DEPRECATED_NO_WARNINGS
    INCLUDEPATH += C:/Practice_Program/Debugging/include

    LIBS += -L$$C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86 -lclfsw32
    INCLUDEPATH += C:/Program Files (x86)/Windows Kits/8.1/Include/um





    #DISTFILES += C:/Practice_Program/Debugging/Log4Cxx/bin.Debug/log4cplusD.lib

    SOURCES += main.cpp\
    mainwindow.cpp \
    loggingserver.cpp \
    src/appender.cxx \
    src/appenderattachableimpl.cxx \
    src/asyncappender.cxx \
    src/clfsappender.cxx \
    src/clogger.cxx \
    src/configurator.cxx \
    src/connectorthread.cxx \
    src/consoleappender.cxx \
    src/cygwin-win32.cxx \
    src/env.cxx \
    src/factory.cxx \
    src/fileappender.cxx \
    src/fileinfo.cxx \
    src/filter.cxx \
    src/global-init.cxx \
    src/hierarchy.cxx \
    src/hierarchylocker.cxx \
    src/layout.cxx \
    src/lockfile.cxx \
    src/log4judpappender.cxx \
    src/logger.cxx \
    src/loggerimpl.cxx \
    src/loggingevent.cxx \
    src/loggingmacros.cxx \
    src/loglevel.cxx \
    src/loglog.cxx \
    src/logloguser.cxx \
    src/mdc.cxx \
    src/msttsappender.cxx \
    src/ndc.cxx \
    src/nteventlogappender.cxx \
    src/nullappender.cxx \
    src/objectregistry.cxx \
    src/patternlayout.cxx \
    src/pointer.cxx \
    src/property.cxx \
    src/queue.cxx \
    src/rootlogger.cxx \
    src/sleep.cxx \
    src/snprintf.cxx \
    src/socket-unix.cxx \
    src/socket-win32.cxx \
    src/socket.cxx \
    src/socketappender.cxx \
    src/socketbuffer.cxx \
    src/stringhelper-clocale.cxx \
    src/stringhelper-cxxlocale.cxx \
    src/stringhelper-iconv.cxx \
    src/stringhelper.cxx \
    src/syncprims.cxx \
    src/syslogappender.cxx \
    src/threads.cxx \
    src/timehelper.cxx \
    src/tls.cxx \
    src/version.cxx \
    src/win32consoleappender.cxx \
    src/win32debugappender.cxx \
    debug/moc_loggingserver.cpp \
    debug/moc_mainwindow.cpp

    HEADERS += mainwindow.h \
    loggingserver.h \
    macros.h \
    ui_mainwindow.h \
    include/log4cplus/boost/deviceappender.hxx \
    include/log4cplus/config/defines.hxx.in \
    include/log4cplus/config/macosx.h \
    include/log4cplus/config/win32.h \
    include/log4cplus/config/windowsh-inc.h \
    include/log4cplus/helpers/appenderattachableimpl.h \
    include/log4cplus/helpers/connectorthread.h \
    include/log4cplus/helpers/fileinfo.h \
    include/log4cplus/helpers/lockfile.h \
    include/log4cplus/helpers/loglog.h \
    include/log4cplus/helpers/logloguser.h \
    include/log4cplus/helpers/pointer.h \
    include/log4cplus/helpers/property.h \
    include/log4cplus/helpers/queue.h \
    include/log4cplus/helpers/sleep.h \
    include/log4cplus/helpers/snprintf.h \
    include/log4cplus/helpers/socket.h \
    include/log4cplus/helpers/socketbuffer.h \
    include/log4cplus/helpers/stringhelper.h \
    include/log4cplus/helpers/thread-config.h \
    include/log4cplus/helpers/timehelper.h \
    include/log4cplus/internal/cygwin-win32.h \
    include/log4cplus/internal/env.h \
    include/log4cplus/internal/internal.h \
    include/log4cplus/internal/socket.h \
    include/log4cplus/spi/appenderattachable.h \
    include/log4cplus/spi/factory.h \
    include/log4cplus/spi/filter.h \
    include/log4cplus/spi/loggerfactory.h \
    include/log4cplus/spi/loggerimpl.h \
    include/log4cplus/spi/loggingevent.h \
    include/log4cplus/spi/objectregistry.h \
    include/log4cplus/spi/rootlogger.h \
    include/log4cplus/thread/impl/syncprims-cxx11.h \
    include/log4cplus/thread/impl/syncprims-impl.h \
    include/log4cplus/thread/impl/syncprims-pmsm.h \
    include/log4cplus/thread/impl/syncprims-pthreads.h \
    include/log4cplus/thread/impl/syncprims-win32.h \
    include/log4cplus/thread/impl/threads-impl.h \
    include/log4cplus/thread/impl/tls.h \
    include/log4cplus/thread/syncprims-pub-impl.h \
    include/log4cplus/thread/syncprims.h \
    include/log4cplus/thread/threads.h \
    include/log4cplus/appender.h \
    include/log4cplus/asyncappender.h \
    include/log4cplus/clfsappender.h \
    include/log4cplus/clogger.h \
    include/log4cplus/config.h.cmake.in \
    include/log4cplus/config.h.in \
    include/log4cplus/config.hxx \
    include/log4cplus/configurator.h \
    include/log4cplus/consoleappender.h \
    include/log4cplus/fileappender.h \
    include/log4cplus/fstreams.h \
    include/log4cplus/hierarchy.h \
    include/log4cplus/hierarchylocker.h \
    include/log4cplus/layout.h \
    include/log4cplus/log4judpappender.h \
    include/log4cplus/logger.h \
    include/log4cplus/loggingmacros.h \
    include/log4cplus/loglevel.h \
    include/log4cplus/mdc.h \
    include/log4cplus/msttsappender.h \
    include/log4cplus/ndc.h \
    include/log4cplus/nteventlogappender.h \
    include/log4cplus/nullappender.h \
    include/log4cplus/qt4debugappender.h \
    include/log4cplus/qt5debugappender.h \
    include/log4cplus/socketappender.h \
    include/log4cplus/streams.h \
    include/log4cplus/syslogappender.h \
    include/log4cplus/tchar.h \
    include/log4cplus/tracelogger.h \
    include/log4cplus/tstring.h \
    include/log4cplus/version.h \
    include/log4cplus/win32consoleappender.h \
    include/log4cplus/win32debugappender.h \
    src/log4cplus.rc.in

    FORMS += mainwindow.ui
    So if you can see above the highlighted includepath that i tired adding for clfsmgmt.h but it did not worked even i am getting more error and i am not able to understand the reason
    C:\Program Files (x86)\Windows Kits\8.1\Include\um\clfsmgmt.h:113: error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Program Files (x86)\Windows Kits\8.1\Include\um\clfsmgmt.h:124: error: C2146: syntax error : missing ';' before identifier 'PolicyFlags'
    C:\Program Files (x86)\Windows Kits\8.1\Include\um\clfsmgmt.h:149: error: C2146: syntax error : missing ';' before identifier 'SizeInBytes'
    C:\Program Files (x86)\Windows Kits\8.1\Include\um\clfsmgmt.h:159: error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    C:\Practice_Program\Debugging\src\clfsappender.cxx :169: error: C2039: 'SizeInBytes' : is not a member of '_CLFS_MGMT_POLICY::<unnamed-type-PolicyParameters>::<unnamed-type-NewContainerSize>'
    C:\Practice_Program\Debugging\src\clfsappender.cxx :188: error: C2039: 'Enabled' : is not a member of '_CLFS_MGMT_POLICY::<unnamed-type-PolicyParameters>::<unnamed-type-AutoGrow>'
    and many similar error
    clfsappender.cxx is third party file where clfsmgmt is windows files.
    I dont have MINGW installed i have installed Visual studio 2013 and Qt has auto detected the same.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: compilation error for CLFS file in qt

    The errors you are getting are not because the header is not found, but because it IS found, and symbols referenced in the file are not found (defined).
    Since this is a windows/
    clfsappender.cxx is third party file where clfsmgmt is windows files.
    I just googled it, and it seems you are using log4cplus.
    At least from the read me on github site of the project, the lib it is not compatible with VS 2013, you either need MSVC2015 or MiniGW:
    Linux/AMD64 with GCC version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)
    Linux/AMD64 with Clang version 3.8.1-12ubuntu1 (tags/RELEASE_381/final)
    Windows/AMD64 with GCC version 4.8.2 (x86_64-posix-seh-rev3, Built by MinGW-W64 project) using CMake build system
    Windows/AMD64 with GCC version 4.9.2 (tdm64-1) using CMake build system
    Windows 7 with MS Visual Studio 2015
    OpenBSD 5.6/AMD64 with GCC version 4.9.0
    FreeBSD 10.1/i386 with Clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032)
    NetBSD 6.1.5/AMD64 with GCC version 4.9.1
    DragonflyBSD 4.0.1/AMD64 with GCC version 4.9.3 20141126 (prerelease) (FreeBSD Ports Collection)
    OpenIndiana Hipster 2016.10 with GCC version 4.9.4
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 3
    Last Post: 14th October 2013, 21:20
  2. Compilation Error , Can't find lib file.
    By vijaydandur in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2011, 05:54
  3. compilation error
    By jjbabu in forum Qt Programming
    Replies: 30
    Last Post: 8th April 2009, 10:20
  4. Replies: 3
    Last Post: 27th December 2008, 19:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.