Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Directory Separator in Makefiles
Forum Updated to NodeBB v4.3 + New Features

Directory Separator in Makefiles

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 2 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JamesBrown147
    wrote on last edited by
    #1

    Hi there!

    I use qt 4.8.0 on windows xp, mingw 4.5.2, win32-g++

    My Problem is that in the Makefiles the directory separator for SOURCES is a "" whereas in the OBJECTS it is a "/". Even in the rest of the Makefile the separators are mixed up somehow.

    The Problem is that the compiler generates warnings like the following:

    code/log_event.h:59:16: warning: xxx
    code/log_event.h:58:18: warning: xxx
    code\log_event.cpp:15:1: warning: xxx

    With the "/" in the Warning it is hard to parse the path to the File. I need this for code analysis via Jenkins.

    If I change all "/" to "" in the OBJECTS then it works fine.

    Does anyone have a solution for this?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JamesBrown147
      wrote on last edited by
      #2

      funny. the documentation says:

      OBJECTS
      This variable is generated from the SOURCES variable. The extension of each source file will have been replaced by .o (Unix) or .obj (Win32). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

      In my Makefile qmake generates .o files.

      Strange...

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JamesBrown147
        wrote on last edited by
        #3

        oh, I just realized that it does not work if I exchange all "/" with "".

        I don't have a clue whats wrong.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          Backslashes are tricky since C++ interprets them in a string as the start of an escape sequence (e.g. '\t' for the tab character). So you need to escape the backslashes by prepending another backslash. That is also true for most other environments like build systems.

          In qmake you should always use '/' as a directory separator, even on windows. That gets you round the escaping issue and -- as an added benefit -- will work on all supported platforms.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved