Error Compiling 3.1.5, "Permission denied"

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Lowkus
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun May 01, 2016 2:48 am

Error Compiling 3.1.5, "Permission denied"

Post by Lowkus » Sat May 29, 2021 8:17 am

I get an error while trying to compile wxWidgets 3.1.5 for Win10. I am using an admin account, running cmd.exe in admin mode, I've turned off my virus scanner, verified I have full permissions in the target directory, but so far this problem will not go away. How can I fix this so I can successfully build wxWidgets 3.1.5?

I enter this...

Code: Select all

c:\Users\Mark\Downloads\wxWidgets>C:\"Program Files"\CodeBlocks\MinGW\bin\mingw32-make.exe -f C:\Users\Mark\Downloads\wxWidgets\wxWidgets-3.1.5\build\msw BUILD=RELEASE
the program responds with this...

Code: Select all

mingw32-make: C:\Users\Mark\Downloads\wxWidgets\wxWidgets-3.1.5\build\msw: Permission denied

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 468
Joined: Fri Nov 03, 2006 2:00 pm

Re: Error Compiling 3.1.5, "Permission denied"

Post by stahta01 » Sat May 29, 2021 10:02 am

Put it in a non user folder or learn how to misuse Windows Permissions to give the Admin right to edit user Files.

NOTE: Building as Admin is a very bad idea!!!

Tim S.

Lowkus
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun May 01, 2016 2:48 am

Re: Error Compiling 3.1.5, "Permission denied"

Post by Lowkus » Sat May 29, 2021 7:45 pm

The user folder isn't the problem, I moved it to a different folder and it produces the same result of "Permission denied".

Code: Select all

c:\wxWidgets>C:\"Program Files"\CodeBlocks\MinGW\bin\mingw32-make.exe -f C:\wxWidgets\wxWidgets-3.1.5\build\msw BUILD=RELEASE

mingw32-make: C:\wxWidgets\wxWidgets-3.1.5\build\msw: Permission denied

PB
Part Of The Furniture
Part Of The Furniture
Posts: 3063
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error Compiling 3.1.5, "Permission denied"

Post by PB » Sat May 29, 2021 7:59 pm

The way you quote the paths looks very odd to me, usually the whole path is enclosed by quotes. I also think you should pass the actual makefile name with the -f parameter, not just a folder name.

But why not trying to do it the normal way instead? In other words:
1. Add the mingw's bin folder to the PATH, even if just for the current command line session
2. CD to wxWidgets build\msw folder
3. Run the make.

Code: Select all

set PATH=C:\Program Files\CodeBlocks\MinGW\bin;%PATH%
cd /d C:\wxWidgets\wxWidgets-3.1.5\build\msw
mingw32-make.exe -f makefile.gcc BUILD=RELEASE

Lowkus
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun May 01, 2016 2:48 am

Re: Error Compiling 3.1.5, "Permission denied"

Post by Lowkus » Sat May 29, 2021 11:06 pm

Your solution to add it to the PATH environmental variable, and launching from within the makefile directory, seems to have worked.

I think Mingw32-make.exe should be bug-fixed so it will run correctly just by typing in the full path of the exe and the full path of the target makefile. It is not intuitive that it would require adding it to the PATH variable and that it must launch from within the target makefile directory. It will create PATH pollution the way it currently sits, and if it's removed from the PATH after the compiling is finished then it becomes one more step to perform the next time the library needs to be compiled.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 3063
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error Compiling 3.1.5, "Permission denied"

Post by PB » Sun May 30, 2021 7:55 am

Lowkus wrote:
Sat May 29, 2021 11:06 pm
I think Mingw32-make.exe should be bug-fixed so it will run correctly just by typing in the full path of the exe and the full path of the target makefile. It is not intuitive that it would require adding it to the PATH variable and that it must launch from within the target makefile directory. It will create PATH pollution the way it currently sits, and if it's removed from the PATH after the compiling is finished then it becomes one more step to perform the next time the library needs to be compiled.
There is no path pollution? The commands I showed you are normally saved as a batch file which can then be executed whenever needed. No one types them in the command line, particularly as in real world, they are usually more complex. Obviously, the PATH is modified only for the current command line session (i.e., for the batch itself), not system wide.

As for the makefile itself, files it refers (e.g., config.gcc) are searched for in the CWD as expected, so the CWD should be the folder with the makefile.

I am quite sure this is the pattern always used when building such a library, both with GCC and MSVC.

BTW, I was right about the original issue being a folder instead of path passed for a makefile. When tried I got the same error, except there was more you did not mention and which makes it clear

Code: Select all

mingw32-make: D:\Dev\Desktop\!Lib\wxWidgets-GIT\build\MSW: Permission denied
mingw32-make: *** No rule to make target 'D:\Dev\Desktop\!Lib\wxWidgets-GIT\build\MSW'.  Stop.

Lowkus
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun May 01, 2016 2:48 am

Re: Error Compiling 3.1.5, "Permission denied"

Post by Lowkus » Tue Jun 01, 2021 1:23 am

PB wrote:
Sun May 30, 2021 7:55 am
Lowkus wrote:
Sat May 29, 2021 11:06 pm
BTW, I was right about the original issue being a folder instead of path passed for a makefile. When tried I got the same error, except there was more you did not mention and which makes it clear

Code: Select all

mingw32-make: D:\Dev\Desktop\!Lib\wxWidgets-GIT\build\MSW: Permission denied
mingw32-make: *** No rule to make target 'D:\Dev\Desktop\!Lib\wxWidgets-GIT\build\MSW'.  Stop.
If I run the commands below from outside of the makefile directory, it fails. If I run it within the makefile directory, it succeeds.

PATH="C:\Program Files\CodeBlocks\MinGW\bin"
mingw32-make.exe -f C:\wxWidgets\wxWidgets-3.1.5\build\msw\makefile.gcc BUILD=RELEASE UNICODE=1 SHARED=0 clean

Lowkus
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun May 01, 2016 2:48 am

Re: Error Compiling 3.1.5, "Permission denied"

Post by Lowkus » Tue Jun 01, 2021 1:36 am

Weirdly though, now I'm getting this error when I try to compile it...

c:\wxWidgets\wxWidgets-3.1.5\build\msw>mingw32-make.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0

if not exist ..\..\lib\gcc_lib\mswu mkdir ..\..\lib\gcc_lib\mswu
if not exist ..\..\lib\gcc_lib\mswu\wx mkdir ..\..\lib\gcc_lib\mswu\wx
gcc -c -o gcc_mswu\wxregex_regcomp.o -O2 -mthreads -DNDEBUG -I..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswu\wxregex_regcomp.o -MFgcc_mswu\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
mingw32-make.exe: *** [C:\wxWidgets\wxWidgets-3.1.5\build\msw\makefile.gcc:5945: gcc_mswu\wxregex_regcomp.o] Error 1

PB
Part Of The Furniture
Part Of The Furniture
Posts: 3063
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error Compiling 3.1.5, "Permission denied"

Post by PB » Tue Jun 01, 2021 5:42 am

Lowkus wrote:
Tue Jun 01, 2021 1:36 am
Weirdly though, now I'm getting this error when I try to compile it...
gcc: error: CreateProcess: No such file or directory
This error is usually avoided by adding SHELL=cmd.exe to your command line arguments, i.e.:

Code: Select all

mingw32-make.exe -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 SHELL=cmd.exe
However, I do not understand how could it work for you before, unless you added a folder with sh.exe to your PATH now (e.g., from GIT or MSYS).


If you are still struggling with just building wxWidgets, I would recommend reading at least the build part of my guide: https://github.com/PBfordev/wxpbguide

BTW, UNICODE=1 is the default for wxWidgets v3.0+, so you do not have to use it. So is SHARED=0.

Post Reply