Author Topic: detect space in file path when use MinGW  (Read 39628 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
detect space in file path when use MinGW
« on: January 05, 2012, 04:01:10 pm »
Currently MinGW can not handle this, can we add some check on this. A lot of beginner will meet this issue.

This is only thought came to my mind.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: detect space in file path when use MinGW
« Reply #1 on: January 05, 2012, 04:20:56 pm »
Patches welcome :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: detect space in file path when use MinGW
« Reply #2 on: January 05, 2012, 07:51:20 pm »
Currently MinGW can not handle this, can we add some check on this. A lot of beginner will meet this issue.
What exactly do you mean? I have all of my projects in a path with spaces ("My Files") and I never experienced any issues so far.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7680
    • My Best Post
Re: detect space in file path when use MinGW
« Reply #3 on: January 05, 2012, 09:16:46 pm »
Currently MinGW can not handle this, can we add some check on this. A lot of beginner will meet this issue.
What exactly do you mean? I have all of my projects in a path with spaces ("My Files") and I never experienced any issues so far.

I have noticed the windres.exe having intermittent issues with spaces in the path in the past few years.
By intermittent, I mean some versions have the issues others do not.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

zabzonk

  • Guest
Re: detect space in file path when use MinGW
« Reply #4 on: January 05, 2012, 09:30:46 pm »
To quote from http://www.mingw.org/wiki/Getting_Started


Quote
MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we strongly recommend that you do not install MinGW in any location with spaces in the path name reference; i.e. you should avoid installing into any subdirectory of "Program Files" or "My Documents", or the like.

Presumably the OP's idea is that if CB detects that MinGWGCC is installed in such a directory, it should issue a warning?


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: detect space in file path when use MinGW
« Reply #5 on: January 06, 2012, 02:01:36 am »
Currently MinGW can not handle this, can we add some check on this. A lot of beginner will meet this issue.
What exactly do you mean? I have all of my projects in a path with spaces ("My Files") and I never experienced any issues so far.
I mean that the source file path may contain spaces.
It looks like it is OK now as you put your project files under "My Files" folder without  any problem. ;)
But why some user still have such problem? Maybe like stahta01 said, only "windres.exe" has this issue.

To quote from http://www.mingw.org/wiki/Getting_Started


Quote
MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we strongly recommend that you do not install MinGW in any location with spaces in the path name reference; i.e. you should avoid installing into any subdirectory of "Program Files" or "My Documents", or the like.

Presumably the OP's idea is that if CB detects that MinGWGCC is installed in such a directory, it should issue a warning?
So, the mingw installed path should not have spaces? right.
This can be checked when the user setting the mingw compiler path.

Here is another thing we can check:
In the compiler's installation directory setting dialog, there are some statement:
Code
NOTE: All programs below, must exist either in the "bin" sub-directory of this path or in any of the "Additional paths"...
So, the first half, can we check there is a "bin" sub-directory in the user setting path? If not, we can give a warning messagebox.


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.