Rename /src/player/util.c ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    Rename /src/player/util.c ?

    It's a small point, but some compilers dislike it when there are two files of the same name. The 'object' files have (for example) 'obj-util.c' so they're no problem, using a a similar approach you could change the util.c in /src/player/ to 'pla-util.c' or 'plyr-util.c'.
    Currently turning (Angband) Japanese.
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by PaulBlay
    It's a small point, but some compilers dislike it when there are two files of the same name. The 'object' files have (for example) 'obj-util.c' so they're no problem, using a a similar approach you could change the util.c in /src/player/ to 'pla-util.c' or 'plyr-util.c'.
    Really? Are you sure that the make rules are putting the object files in the right place? I started using subdirectories to avoid ridiculous names...
    takkaria whispers something about options. -more-

    Comment

    • PaulBlay
      Knight
      • Jan 2009
      • 657

      #3
      Originally posted by takkaria
      Really? Are you sure that the make rules are putting the object files in the right place? I started using subdirectories to avoid ridiculous names...
      Yes. Talking about Open Watcom in particular here (although I'm pretty sure I saw it in another compiler before). Although it says "\player\util.c" in the list of files to add, when you try to add the \util.c file the error message

      Conflicting file 'player\util.c' found in target 'Angband65.exe'

      is displayed.
      Currently turning (Angband) Japanese.

      Comment

      • takkaria
        Veteran
        • Apr 2007
        • 1951

        #4
        Originally posted by PaulBlay
        Yes. Talking about Open Watcom in particular here (although I'm pretty sure I saw it in another compiler before). Although it says "\player\util.c" in the list of files to add, when you try to add the \util.c file the error message

        Conflicting file 'player\util.c' found in target 'Angband65.exe'

        is displayed.
        *sigh* I'm not willing to change source code organisation to work around bad tools. Is there any chance you could file a bug report on it with the OpenWatcom people? I wasn't even aware Watcom existed anymore...
        takkaria whispers something about options. -more-

        Comment

        • PaulBlay
          Knight
          • Jan 2009
          • 657

          #5
          Originally posted by takkaria
          Is there any chance you could file a bug report on it with the OpenWatcom people? I wasn't even aware Watcom existed anymore...
          They are, but it looks like it's a bad choice anyway.

          I've reported the bug to Open Watcom.

          [EDIT] It looks like what the problem is is that it creates all .obj files in the base (/src) directory whether the source files were in a subdirectory or not. So it's a compiler error, I guess, not an IDE error as I thought.
          Last edited by PaulBlay; April 8, 2009, 18:11.
          Currently turning (Angband) Japanese.

          Comment

          • ekolis
            Knight
            • Apr 2007
            • 921

            #6
            Since the same issue is occurring with MSVC++ 2008 as well, perhaps you might reconsider your position on this, Takkaria?

            edit: oh, wait, I just found a nifty feature in VC++... you can override the name of the obj file generated for a specific c file! Perhaps there is such a feature in OpenWatcom?
            Last edited by ekolis; August 6, 2009, 15:37.
            You read the scroll labeled NOBIMUS UPSCOTI...
            You are surrounded by a stasis field!
            The tengu tries to teleport, but fails!

            Comment

            • takkaria
              Veteran
              • Apr 2007
              • 1951

              #7
              Originally posted by ekolis
              Since the same issue is occurring with MSVC++ 2008 as well, perhaps you might reconsider your position on this, Takkaria?
              Maybe. I really don't understand how MSVC can be that bad, though. There must be other projects which have more than one file with the same name in different directories...
              takkaria whispers something about options. -more-

              Comment

              • Sergio
                Scout
                • Aug 2009
                • 26

                #8
                There are two bugs in Connect for your issue with Visual C++. It's a bug, and while it works just fine in VS2005, it's broken in VS2008. Sadly, it won't be fixed any time soon (maybe VS10).


                Comment

                • zaimoni
                  Knight
                  • Apr 2007
                  • 590

                  #9
                  Originally posted by ekolis
                  edit: oh, wait, I just found a nifty feature in VC++... you can override the name of the obj file generated for a specific c file! Perhaps there is such a feature in OpenWatcom?
                  Yes: have to use non-default makefile rules, but any vaguely aware make utility has this capability.
                  Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
                  Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
                  Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by ekolis
                    Since the same issue is occurring with MSVC++ 2008 as well, perhaps you might reconsider your position on this, Takkaria?

                    edit: oh, wait, I just found a nifty feature in VC++... you can override the name of the obj file generated for a specific c file! Perhaps there is such a feature in OpenWatcom?
                    How do you do that? And how do you do it on the commandline?
                    takkaria whispers something about options. -more-

                    Comment

                    • ekolis
                      Knight
                      • Apr 2007
                      • 921

                      #11
                      Right-click the file in Solution Explorer, then hit "Properties"... select the configuration (you probably want "all configurations" - why they never made that the default I don't know!!! Setting the same settings twice because I forgot to switch from "debug" is ANNOYING!!! ) Anyway, under "Configuration properties | C/C++ | Output files" there's an option called "object file name". It should be set to $(IntDir)\ or something by default - that's a macro that points to the obj directory. Tack something else on the end there - e.g. "player-util.obj", leaving the original $(IntDir)\ in there so that it places the file in the right directory.

                      The command line option appears to be /Fo and you use it like so:

                      cl.exe /Fopath\to\my\file.obj file.c

                      How to do that for multiple files I don't know; heck, I don't even know if Microsoft's command-line compiler is capable of compiling multiple files at once or if you just invoke it once for every file

                      I don't know if there's any way to do this globally per folder (so foo.c gets mapped to $(IntDir)\foo.obj, fred\bar.c gets mapped to $(IntDir)\fred\bar.obj, etc.); I couldn't find anything like that in the GUI, but there might be on the command line...
                      You read the scroll labeled NOBIMUS UPSCOTI...
                      You are surrounded by a stasis field!
                      The tengu tries to teleport, but fails!

                      Comment

                      Working...
                      😀
                      😂
                      🥰
                      😘
                      🤢
                      😎
                      😞
                      😡
                      👍
                      👎