Compile C code for Windows 64

I have not touched C for years, but I need to compile the C source code for Windows 7 64. The source comes with a makefile. Can someone recommend a C compiler with make?

PS:

Make file:

POSTFIX="_amd64" CC = CC="cc -Wall" RANLIB=RANLIB="ranlib" INSTALLDIR=/usr/local/bin LIBINSTALLDIR=/usr/local/lib VERSION=4.12 DATE=10/10/10 PROGRAMS=bib2xml ris2xml end2xml endx2xml med2xml isi2xml copac2xml \ biblatex2xml ebi2xml wordbib2xml \ xml2ads xml2bib xml2end xml2isi xml2ris xml2wordbib modsclean all : FORCE cd lib; make -k $(CC) -k $(RANLIB); cd .. cd bin; make -k $(CC) -k VERSION="$(VERSION)" -k DATE="$(DATE)"; cd .. clean: FORCE cd lib ; make clean ; cd .. cd bin ; make clean ; cd .. cd test ; make clean ; cd .. realclean: FORCE cd lib ; make realclean ; cd .. cd bin ; make realclean ; cd .. cd test ; make realclean ; cd .. rm -rf update lib/bibutils.pc test: all FORCE cd lib ; make test; cd .. cd bin ; make test; cd .. install: all FORCE cd lib ; make -k LIBINSTALLDIR=$(LIBINSTALLDIR) install; cd .. sed 's/VERSION/${VERSION}/g' packageconfig_start > lib/bibutils.pc @for p in ${PROGRAMS}; \ do ( cp bin/$$p ${INSTALLDIR}/$$p ); \ done package: all FORCE csh -f maketgz.csh ${VERSION} ${POSTFIX} deb: all FORCE csh -f makedeb.csh ${VERSION} ${POSTFIX} FORCE: 
+6
source share
5 answers

Since everyone here does not pay attention to your clear 64-bit operator, I will give the correct answer:

  • If the make file is an Nmake file, you can install Visual Studio Express for Windows Desktop , open a command prompt from the Start menu (select one target 64-bit Windows), cd into the project directory and run nmake . You will need to modify the makefile to invoke cl and the link.

  • If the Makefile is a MinGW make file, you will need the mingw-w64 program chains targeting Win64 (note also the 32-bit tool chains provided). I recommend official builds provided through the installer , or those installed with MSYS2 (see Clause 3). Install, open the command line MinGW-w64, cd in the project directory and run mingw32-make .

  • If the Makefile is a Unix / MSYS make file, I suggest using MSYS2 . You can use the above toolchain or make pacman -S mingw-w64-x86_64-gcc to install the toolchain from the MSYS2 shell. Be sure to add /mingw64/bin to your PATH or run with "MSYS2 MinGW-w64 64-bit" to use it. Please note that you can use MSYS2 only as a package management tool: install any dependency you want (there are tons of binary files from third-party libraries ready for use) and just add the <MSYS2 root>/mingw64/bin to PATH and call compiler from anywhere.

  • If the project uses Unix functionality (for example, fork() or other Unix system calls), you can use the 64-bit Cygwin , install its compiler and link it to the Cygwin dll. This is not recommended because there is performance (well, compared to porting the code to the Win32 API) and a license penalty (The Cygwin DLL is the GPL, which forces your license to be licensed in a GPL-compatible way).

These are four ways to compile the C source file for 64-bit Windows with free tools. If you are a student, perhaps you can also use the following methods:

  1. Download Visual Studio Professional from Dreamspark (if there is an agreement with Microsoft for your university / college / school) and use this. Pretty much equivalent to point 1, unless you use things like the MFC / ATL and / or VS plugins that don't work in the express version.

  2. Download the Intel compiler from your site for training suggestions . Requires Visual Studio Professional from step 5. You will need to modify the Makefile to use the Intel compiler.

  3. Download the LLVM / Clang compiler from here (a Windows snapshot is created) and use it in conjunction with step 5. You "I need to modify the makefile to invoke clang.

I know this is more than you asked, but my high-rated answers should be complete, right?

+12
source

You can use Visual C and look at nmake

see: How to use makefiles in Visual Studio?

+1
source

You can try MinGW to have files similar to GCC.

+1
source

Take a look at http://www.cygwin.com/

+1
source

Code :: Blocks comes with a built-in Mingw framework that should handle make files just fine.

+1
source

Source: https://habr.com/ru/post/887930/


All Articles