compiling from the command line

hi guys I am trying to set up wxWidgets with codeblocks I set the path variable to my codeblocks\Mingw\bin directory I copied and pasted it so I know it's correct

but when I try to see if my compiler is working it seems to give me an error on the command line

'mingw32-gcc' is not recognized as an internal or external command,
operable program or batch file.

I tried reading multiple articles online but none helped,the weird thing is my programs compile and run fine in codeblocks

I am using a windows 10 64 bit machine


Is mingw32-gcc the same command that Code::Blocks uses? Look in the bin folder to make sure that such a file actually exist. For C++ you probably want to use something that contains the word 'g++'.

I looked in the bin folder

and I have the following files


I tried running the ones with c++ and g++ and gcc but no luck,I am in the home directory but setting the path to this I'm guessing I don't need to be in the mingw directory

'mingw32-g++' is not recognized as an internal or external command,
operable program or batch file.

Last edited on
note it works when I try to use g++ by itself

also I have mingw's once in codeblocks folder and one in my users folder for eclipse

will this cause any problems?(I'm not sure which one is running with the command g++)
Last edited on
this is the command code blocks is running when I compile

mingw32-g++.exe -Wall -fexceptions -g -c C:\Users\User\Desktop\foldd\codeBlocks\again\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\again.exe obj\Debug\main.o
Output file is bin\Debug\again.exe with size 1.01 MB

it is calling mingq32-g++ but when I try to call it in the command line it fails,I set my envirement path to the folder in which ming32-g++.exe is located which is the bin folder inside mingw inside codeblocks

note I have many different evnirement paths not just one,would this have any affect on it?

I'm guessing no because eclipse still runs fine with another version of mingw
I think you can run where g++ to see where the g++ command is located.

Otherwise you can use g++ --version to at least find out which version it is.
Hi Peter

it says it is located in my mingw folder the one eclipse uses not codeblocks's mingw
Hi Peter

I tried deleting the path and then setting it again this time it actually worked

thanks for all the help you are awesome if I run into any more problems I'll post them here
hi guys I have run into yet another problem

it seems libwxmsw30u.a is missing,in order to run the code is looking for libwxmsw30u.a but my install of wxwidgets did not include libwxmsw30u.a instead included libwxmsw31u.a

anybody know where I can download this missing file?

also I seem to get an error

wx/setup.h: No such file or directory.

the linker needs it

Last edited on
I followed all of these posts on

but non of them have solved the problem

I even put the dll's from \lib\vc_dll into build/msw and still nothing same error
Last edited on
Topic archived. No new replies allowed.