

Navigate to Control Panel -> System -> Advanced System Settings and then:

įrom the options install mingw32-base and mingw32-gcc-g++`, you can also install the other components if you wish, but all you need is the c++ compiler (g++). MinGW is a c/c++ compiler for windows, head to their website and download the latest version. You’re obviously interested in open source or you wouldn’t be here - so I’m telling you to take the plunge, go all in, close this tab and grab an image of Ubuntu or Mint if you want to be just like me and become enlightened! Linux is quite often the first priority for developers of open source tools and windows support is sometimes an after thought. I also personally recommend staying away from IDEs. and using Linux is the best way to see and learn how this works. Most people I know barely understand setting up their own C++ projects and linking to 3rd party libraries etc. Why should you use Linux? There’s a lot of reasons in my opinion but right now I am going to keep it simple. I guess you need to have a bit of luck with this.Much to my dismay this tutorial is by far the most visited page on my website, why does this upset me? It upsets me because as glad as I am to see people using open source tools like OpenCV and MinGW rather than proprietary or commercial alternatives I feel strongly that developers should be using Linux not Windows for coding, especially for C++. I was interested in setting up graphics for Code Blocks when I ran into a this error: (took me 2 hrs to solve it) Reminds me of the 2006 comedy show It Crowd. The answer is "TRY TURNING IT ON AND OFF". Well I know this answer is not an experienced programmer's approach and of an Old It consultant, but it worked for me. This would normally result in an undefined reference to jRegister(), but you've declared the function inside main instead of calling it. Your other attempt, compiling and linking just trial.cpp, never links secrypt.cpp. In order to compile and link both source files, you'll need to do it manually or add them to the same project.Ĭontrary to what others are saying, using a Windows subsystem with main will still work, but there will be no console window. That file, from your picture, is secrypt.cpp, which does not have a main function. When there's no project, Code::Blocks only compiles and links the current file.
