> I have seen a few times that c++ development on Windows is a pain
No, Windows is a perfectly good C++ development environment - it's what I use for all my primary C++ work; I then port the code to other platforms. What is a pain is Windows GUI programming in C++ - if that's your target, then I would suggest either learning C# instead, or using a toolkit like Qt and the associated Qt development tools.
For C++ IDE development on Windows, you either need to use Visual Studio, which is an excellent IDE, or an IDE which uses GCC (or clang) such as CLion. The best source for GCC on Windows is IMHO, TDM GCC, which you will need to install in addition to CLion. CLion is very capable, but whether you enjoy using it will to a certain extent depend on how much you like CMake, which is its build tool - personally I don't like it much at all and use Code::Blocks as my IDE of choice.
On the website of your compiler:
> It can create 32-bit OR 64-bit binaries, for any version of Windows since Windows 98.
So I don't think your compiler can do that.
Compiling for a different platform than the one you're using is called "cross-compiling". Using that as a search term, you can find more information and more options, e.g. here.
Why are you being downvoted? I've not been able to download a compiler from MinGW in more than a year --- I simply cannot find it. You can, however, download it from TDM GCC.
Using Visual Studio, use the Start Menu to run the command prompt for visual studio (installed as part of the VS installation) and then do:
cl /Fa mycode.cpp
in the directory containing the file mycode.cpp. This will produce the file mycode.asm. Alternatively, use the VS debugger, and select "Go to assembly" from the debugger context menu.
Or simply install GCC on Windows - this is very easy to do via this MinGW implementation.
You compile it. You could do this with Microsoft Visual Studio, or with a command-line compiler like GCC.
However, if you are completely new to this, you would probably be better advised to start off with a different, easier-to-use language, such as Python. Have you read the FAQ on the subject?
> So I've read that C++ has issues with 64-bit operating system
Where did you read that? C++ is a language standard - it doesn't have anything to say about 64-bit operating systems. And there are several Windows 64-bit implementations available, or you could always use a 32-bit implememtation.
> Now I've tried Turbo C++ and DOSBOX on both, Windows 7 and an XP emulator.
Why would you do that? Turbo C++ is beyond obsolete.
> I would really appreciate some help in installing C++ and getting it to work properly.
I'd strongly suggest not using Cygwin, unless you actually require the POSIX-compatibility it provides. Either use Windows-native MinGW GCC (for example TDM GCC) or use Visual Studio.
Visual C++ is a great IDE (and the express edition is free), but it has its defects as a C++ and C compiler. For Windows, you probably want to go the MinGW route - an easy to install version is here. If you want a free, open-source IDE, Code::Blocks is very good.
There's nothing really to change it to (though there might be one day). But that val is an environment variable, so you just set it like any other (via set in cmd). If you want to use CGo (which that lib uses) you have to use gcc. Install http://tdm-gcc.tdragon.net/ and make sure gcc.exe is on your PATH is one way, MinGW is another. See the build docs of that lib for details.
It's pretty trivial, at least for Windows. First, install GCC. If you are on Windows, I recommend http://tdm-gcc.tdragon.net. Then start Clion and choose File|Settings... In the dialog that appears, choose Build, Execution, Development|Toolchains, check the "Use MinGW Home" radio button and enter the name of the directory you installed TDM GCC in - for example, on my system this is C:\prog\tdm492 - yours will be different. Make sure "Use bundled CMake" and "Use bundled GDB" are both checked, and you are ready to go.
The GCC (Gnu Compiler Collection) tools include a Fortran compiler (gfortran). You don't say what platform you are on, but you can get a version for Windows from here - use the on-demand installer.
It's perfectly acceptable to use time(NULL) to seed a generator for things like games and other non-critical applications. It's not OK to use it for critical stuff like cryptography for banking applications.
Please ignore the following and see /u/rhomboid's answer.
Edit: And random_device is supported on MinGW GCC 4.8.1 on Windows. Here's some code compiled with it:
#include <random> #include <iostream>
int main() { std::random_device rd; std::cout << rd() << std::endl; std::cout << rd() << std::endl; }
which produces:
3499211612 581869302
That's with TDM GCC.
GCC is the Gnu Compiler Collection. It includes both C and C++ compilers and optionally other compilers too. If you want to install it for Windows, one of the easiest places to get it from is here - it should already be installed on most Linux developer-oriented distros.
It should do, although I would suggest giving it a test. It includes libraries from mingw-w64 including 64bit support, which is different from tdm64-gcc from what I can see though it should be compatible. The configuration of .goreleaser.yml is slightly differnt see this example and note the env settings.
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
Please give it a try and if it doesn't I can add tdm64-gcc the library to the docker file.
I don't know if it has c11 multithreading but I've used pthreads on Windows with the TDM GCC Compiler Suite. It uses the MinGW -w64 compiler and also supports OpenMP. I haven't had any issues using pthreads.
This is the tutorial I originally followed to get it installed:
http://deeplearning.net/software/theano/install_windows.html
It looks like an absolute pain, but once you've got it working the first time, it's a lot easier.
Are you using CUDA/GPU or just CPU? Getting it to work on the CPU is a lot easier, and once that's working then you can configure for GPU if you have one.
So try this first, and let me know how you get on:
The easiest way to do it is to firstly install WinPython, and not standard Python (it does the same thing, but is easier to get to work well on Windows):
Then install the TDM-GCC compiler, which is available from:
The tutorial says you don't need to, but it's much easier if you add the compiler bin directory to your path environment variable. And it also needs to be before any other GCC compiler in the path string. At the same time, add your WinPython bin directory to the path variable.
E.g. Add something like this:
D:\Programs\TDM-GCC-64\bin;D:\Programs\Python\WinPython-64bit-3.5.1.2\python-3.5.1.amd64;D:\Programs\Python\WinPython-64bit-3.5.1.2\python-3.5.1.amd64\Scripts
Now we should be able to install Theano. The tutorial says to use the version from Github. I haven't found that to be necessary. Additionally, we only like to install slightly older versions on our servers, as (in theory) they're less likely to have unexpected problems. To install the stable version, in a command prompt just enter:
easy_install theano
And that should do it. easy_install will use whatever network or proxy settings you have configured in control panel, so it gets around problems with configuring pip on Windows, which can be problematic on a corporate network.
Let me know how you get on.
I think the first bullet point under pthreads is out of date: mingw-w64 4.9.2 supports std::thread and related using Win32 native threads plus a free header-only patch.
Are you working with C or with C++? Those are two different languages.
On Windows, there are two compilers that you can acquire for free that compile C++. That's MSVC and MinGW. MinGW in practice comes in the form of various distributions, so there are many "MinGW" websites, and you pick which distribution you want to use.
Either will work with C++, but if you want to write modern C code, I suggest MinGW instead. You get MSVC by installing Visual Studio. You get MinGW by picking a distribution. I suggest TDM-GCC to start with.
Here's what you should do.
If you run into errors, tell us exactly what steps you took, and exactly what errors you got.
If you use MinGW, you'll need to get an IDE separately. But that's a different issue, and can be dealt with later. First, get a compiler working on your computer.
I don't use Macs, but installing GCC on Windows is trivially easy (see http://tdm-gcc.tdragon.net/) and it normally comes with most Linux developer distros, but if not is once again trivially easy to install using something like apt-get.
For installing MinGW, I recommend you use TDM-GCC. Grab the bundle download (tdm64, since you look like you want to target 64 bit executables) and when installing, make sure you select fortran in the list of installed packages.
For setting up DDSCAT, apparently, they offer precompiled version of the code, so you should probably start there first.
Definitely FORTRAN - which standard doesn't really matter I suspect - you could probably do everything you want to deal with 3D problems in F77. The thing FORTRAN is great at is having lots of very, very powerful and efficient libraries for doing things like matrix manipulation. You may (probably will) find there are libraries to deal with your specific problem area - Google is your friend.
As for which specific compiler? Well that depends on whether you have money to spend. You can get a free one at http://tdm-gcc.tdragon.net
And for an IDE? There are as far as I know no great free FORTRAN IDEs - you would be best advised to learn a powerful editor like vim or emacs.
> MinGW-TDM
I'll give it a shot, thanks!
Also, I can only seem to be able to find the 5.1 version: http://tdm-gcc.tdragon.net/download I'll us 5.1 for the test tho, I'll be back soon if I can :), again tahnks a LOT
> have installed all of the proper packages for basic compilation of C programs
What would those be? MinGW GCC has everything you need to build C programs. I would recommend expunging every trace of GCC and these "packages" and re-installing from scratch. If you want a foolproof installation, see http://tdm-gcc.tdragon.net/
If you want to develop on windows and need CGO, a really easy drop in gcc to use is this: http://tdm-gcc.tdragon.net/ - just throw the installed location in your path and should be good to go. Have used this to good effect with quite a few beginners to get them into go smoothly.
That said, I've used msys2, cygwin and wsl and probably the easiest of these to use is msys2. If you want to cross compile for linux or osx use wsl though, don't bother setting up a cross compiler.
Well, I use ConEmu (with bash) and have never seen a problem like that. I would try re-installing MinGW - get the TDM version, which I've always found ti be very reliable.
Code::Blocks supports Fortran development - you will also need the GCC Fortran compiler, which I don't think is installed by default, but you can get it from TDM.
Mingw using gcc, you can setup it like here, make sure that you setuped you path to location when is minwg binaries are (http://www.computerhope.com/issues/ch000549.htm), better use http://tdm-gcc.tdragon.net/ than mingw it's the same compiler but much newer version of gcc and gdb than mingw. You can use it with Code blocks for example
What is the name of perl###.dll in e:\program_files\perl64\bin? PERL_VER should be the ### part of the filename. I got similar messages when compiled with wrong version number. As I can see, You are not a newbie, but anyone can make mistakes. Another problem was for me is using Mingw instead of Tdm-gcc - download the installer, the architecture (x86/x64) can be selected when You starting install.
You will need to have GCC and GNU make installed. You can get them both in one package from here. However, there is no guarantee that any random makefile-based project you pick up will build on Windows, even with GCC and GNU make installed.
Ok, and what MinGW distribution did you install? If you're not sure, give us a link to the website where you downloaded the installer? Some of my MinGW installations do have a zlib dependency, some don't have the DLL around.
Here's what I actually suggest. Grab TDM-GCC and use one of the installers at the top of this download page. They should install everything correctly and neatly for you.
In some ways, it's easier to use a text-editor and a command line compiler like TDM GCC to write small, simple programs. Also, do you have any particular reason for learning C++ as a first language? The consensus here is to use an interpreted language like Python to learn the basics of programming.
You can't simply move directories around like that GCC requires a particular directory structure in a particular place in order for it to work correctly. You might be best-advised to re-install GCC - get it from TDM. And it's never a good idea to install anything in the C:\ root directory.
Are you asking about a compiler or a build system? For the compiler, I'd use GCC, which is available for Windows in several forms, easiest to get to grips with probably this one. For the build system, I'd learn GNU make (which comes with the GCC distribution I suggested). Apart from anything else, it has an excellent manual. And if you want a cross-platform C++ IDE, take a look at Code::Blocks.
Sure, just head over to the GCC-TDM site and download whichever version your install of Windows will support (either the x64 or x86 version, don't worry about the other downloads). I tend to stick with x86 since it's more stable. Then after getting GCC installed, Follow these instructions to install MSYS. Just read the part under "Installing MSYS" and you should be good. After that, fire up Netbeans, go into your settings and under the "C/C++" tab, click on the button to add an installation, and point it to your mingw installation directory (such as C:\mingw\bin). Netbeans will automatically detect where the compiler and it's other tools are. Finally click OK and you're good to go.
That page suggests using a monstrously obsolete version of the GCC fortran compiler, which may be your problem (and I have no idea what "f2exe" is. To get an up-to-date version, first download the GCC C/C++ compilers - simple instructions are here. Check they work.
Then from the same TDM site at http://tdm-gcc.tdragon.net/download download the fortran support files (you want the first zip). Unzip these into the directory you installed the C++ compiler. This should give you the modern GNU fortran compiler, who's executable is called gfortran.exe.
Well, tdm-gcc has a 32 and 64-bits distribution and only the 64-bits one can produce 64 bits code.
edit: ok it's not a 64-bits distribution, its a special version that is able to produce 64 bits code. Doesn't matter, for the nuwen.net distro I couldn't find this information, hence my question.