News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

detect space in file path when use MinGW

Started by ollydbg, January 05, 2012, 04:01:10 PM

Previous topic - Next topic

ollydbg

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.

oBFusCATed

(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!]

MortenMacFly

Quote from: ollydbg 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.
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

Quote from: MortenMacFly on January 05, 2012, 07:51:20 PM
Quote from: ollydbg 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.
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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

zabzonk

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


QuoteMinGW 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?


ollydbg

Quote from: MortenMacFly on January 05, 2012, 07:51:20 PM
Quote from: ollydbg 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.
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.

Quote from: Neil Butterworth on January 05, 2012, 09:30:46 PM
To quote from http://www.mingw.org/wiki/Getting_Started


QuoteMinGW 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:
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.