How can I compile JeMalloc on Windows? I've looked on their github and there are no instructions how to build it.
You need to build it with MinGW - probably MinGW-w64. Use MSYS2 to run the install scripts. It basically mimics a Linux environment on Windows. Follow the directions in the INSTALL file in the repository. You should be able to Google the details. Any decent MSYS2 build tutorial should be helpful.
Related
So I decided to install a c++ compiler for Windows and thus downloaded the MinGW installer. Once I opened it, I saw a number of packages and checked all the "C++ compiler" packages (am I using the right terminology here?) for installation. I also saw other stuff like "mingw32-base" and all. What does this do? Should I install it? Also, what is the difference between mingw and mingw32?
If you don't need additional packages you shouldn't install them.
But MinGW is a bit outdated. It's better to switch to MinGW-w64, which exists for both 32-bit and 64-bit Windows.
You can get MinGW-w64 either by installing MSYS2 and installing via its package manager (pacman), or - if you don't need the additional MSYS2 shell and just want to compiler tools - you can get a standalone package from https://winlibs.com/ and just unzip it.
I have an application that I built using Qt Creator on Linux and want to deploy it now. However, I don't want to statically build it as I don't want it to be open-sourced. I tried the ldd ./YourExecutable command, however that only lists (and not add) the additional dependencies the application needs in order for it to run. My question is, how do I gather the necessary dependencies without having to individually look for these files? Is there a tool, such as windeployqt.exe on Windows, that I can use on Linux for the same purpose? Or is there a better approach than the one I'm thinking of?
Get Cygwin setup.exe: http://www.cygwin.com/
1.1. Run setup.exe and continue to package selection list.
1.2. Under Devel catagory select tools you need for compiling your source. For
example 'GNU make'.
1.3. Finish installing.
Get linux crosscompilers for cygwin:
"cygwin-gcc-linux.tar.bz2" (68.2 Mb).
md5sum: 340e91a346f5bb17e660db10e43005b8
These compilers are made with crosstool 0.28-rc37. This package contains:
gcc-3.3.4 and gcc-2.95.3 for i386 (glibc 2.1.3) and gcc-3.3.3 for amd64
(glibc 2.3.2).
Note! There is now newer version of GCC avaible with glibc 2.3.2:
"cygwin-gcc-3.3.6-glibc-2.3.2-linux.tar.bz2 (i386, x86_64)".
2.1. Copy 'cygwin-gcc-linux.tar.bz2' to 'c:\cygwin' or install directory which
you selected in setup.exe.
2.2. Open Cygwin shell and change directory to root with 'cd /'.
2.3. Uncompress to Cygwin root with command:
'tar -jxvf cygwin-gcc-linux.tar.bz2'.
Cross-compilers are installed under '/opt/crosstool'. You can use theim
directly or with commands: gcc-linux, g++-linux, gcc-linux-2.95,
g++-linux-2.95, gcc-linux-x86_64 and g++-linux-x86_64.
From: Cross-compiling on Windows for Linux
More info here.
It sounds like you want to use the shared library deployment option:
http://doc.qt.io/qt-5/linux-deployment.html#creating-the-application-package
Then if you wanted to go further than that, you could look into making a .rpm or a .deb .
There are lots of examples of qt projects that are now available on GitHub and have packages made. Usually for prebuilt binaries you need to make one for x86 and a separate one for x64.
Hope that helps.
I'm trying to build OPAM within Cygwin in Windows 8. Here is the error information during the configure stage:
configure: error: You must install the Camlp4 pre-processor. On some
operating systems, these are separate packages from the main OCaml
compiler, such as camlp4-extra on Debian.
I've searched cygwin repository using keywords "caml" and installed all the packages provided; however, the configuration still shows this error message. How can I install this Camlp4 pre-processor?
As long as OPAM doesn't work on windows, you can try GODI (windows port). It has basic windows support and you can install the most common packages through it.
I don't think OPAM works with windows quite yet. I've installed it on OSX and Linux and love it. On windows, though, there is a compilation error with unix_waitpid. This is because ocp-build/ocp-build.boot is a binary packaged with the OPAM source that requires the unix_waitpid instead of the win_waitpid function. I'm not exactly sure why they did this. But, after that their could be other issues.
Regarding the camlp4, running setup.exe of cygwin, I was easily able to find ocaml-camlp4 under interpreters. Depending on the tool-chain, I found it easy enough to just use the mingw binaries found through the ocaml website.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Are there any user friendly tools out there to cross-compile from Windows to Linux?
crosstool-ng supports building cross-compilers with cygwin host.
Overview:
Install cygwin, with development packages
Download crosstool-ng
Extract the tarball (tar xvjf crosstool-ng*)
Run ./configure
When configure complains about a missing tool, go back to cygwin setup and install the corresponding package (e.g. flex, libtool, ncurses-devel) You'll need at least the following:
Devel/gperf
Devel/bison
Devel/byacc
Devel/wget
Devel/patch
Devel/make (GNU version)
Devel/automake 1.10+
Libs/libncursesw10
Libs/libncursesw10-devel
make
make install
Create a new directory for building the cross-compiler, e.g. /usr/src/cross-linux-gnu-root
Enable system-wide case sensitivity support in the registry (see https://superuser.com/questions/266110/how-do-you-make-windows-7-fully-case-sensitive-with-respect-to-the-filesystem#answer-842670)
Mount the directory case-sensitive (e.g. mount c:/cygwin/usr/src/cross-linux-gnu-root /usr/src/cross-linux-gnu -o binary,posix=1)
From inside the cross-compiler build directory, ct-ng menuconfig
In the menus, set target architecture to x86 (probably) and subarchitecture to i686 (avoids GCC 4.8 issues, thanks osm0sis), target kernel to linux, and target C library to glibc, and enable the C++ compiler.
To work around make 4.0 issues, also enable EXPERIMENTAL in Paths and misc options then, go in Companion tools (at top-level) and enable Build some companion tools and then make 3.81 (Thanks osm0sis)
wget has issues with the latest kernel.org certificates so use the .wgetrc method in this accepted answer: How do I fix certificate errors when running wget on an HTTPS URL in Cygwin? (Thanks osm0sis)
Currently 3 file patches are required to avoid further errors:
the _libintl_gettext error as mentioned in the comments
the byteshift headers, and
the ELF headers (Thanks Duncan Calvert & osm0sis)
ct-ng build
Of course, this is NOT going to enable you to build linux applications from inside Visual Studio. (VS2010 and later let you build with other toolchains such as gcc, but you'd need an appropriate toolchain description in addition to the cross-compiler built by crosstool-ng). But you'll have a working g++-linux-gnu, which you can either run directly or using a Makefile.
NOTE: Building the cross-compiler takes a LONG time. osm0sis has provided a prebuilt gcc 4.8.1 here, along with his notes on building the cross-compiler (used to update this answer).
Your best bet is to use a cross platform IDE like Code::Blocks that can import MSVC projects, and generate a Makefile for Linux, which you can then run on a Linux (with even the same program if you so wish).
So your work flow would then look something like the following:
Code, Compile, and debug on MSVC -> import into Code::Blocks & generate Makefile
-> test compile and debug with GCC
-> copy to Linux with Code::Blocks -> test compile & debug on Linux
It's a little obtuse, probably, but at least Code::Blocks takes care of a lot of those small details with things like Makefiles, and what not.
Compile to Linux from Windows without to use virtualization or cross compiler but only natively via CoLinux. Create native Linux executable files without leave (reboot) windows. C/C++ Compiling for Linux under Windows through Cooperative Linux. The fastest switching between Windows and Linux through Alt+Tab (no restarting or rebooting needed):
Install CoLinux
Use CoLinux root file system image: Ubuntu-9.04-1gb.7z
Start CoLinux
Change string archive.ubuntu.com to old-releases.ubuntu.com with:
$ sudo vi /etc/apt/sources.list
Update your configuration:
$ sudo apt-get update
Install two software packages to be able to compile your programs (c/c++, gcc compilers, mysql dev 5.1):
$ sudo apt-get install build-essential
$ sudo apt-get install libmysqlclient15-dev
Accessing Windows directories from CoLinux:
$ mount cofs0 /mnt/ -t cofs
$ cd /mnt
Compile
$ c++ your.source.cc -o executable.name
Are you asking for something that can take code written to run on Windows and make it run on linux? There's not really a compiler that does that - but maybe you're looking for Wine ( http://www.winehq.org/ ) which lets you run Windows apps on linux (if they use APIs Wine has thunked out).
Edit: I'm assuming your code is using Windows APIs (Win32, etc.) in this answer. If you're only using Standard C++ and libraries available cross-platform, then there's lots of other answers.
I don't believe there are any compilers that allow you to compile on Windows and then take the resulting binary and run it on a Linux machine. Your best bet is to set up two development environments, one on Windows and one on Linux. Do most of your development and debugging in the Windows environment if that's what suits you, then frequently compile and test under Linux to be sure your code is truly cross-platform. You'll also want to use a cross-platform build system and testing framework. I recommend using cmake and Google Test, respectively.
What is the equivalent of ./configure in Windows?
Sometimes I download a C/C++ library and when I use the make it, it says "use ./configure" but obviously ./configure can only be used on a Linux machine and the libraries don't usually have instructions for compiling on Windows (although they do support Windows, they don't provide instructions).
For example, the library wxSVG says it works on Windows, but when I download it I don't see any instructions for compiling on Windows, and I only Linux files for configuring it.
I just faced with the same issue and here is what I did,
I first installed MinGw using the installation manager (with msys base included). Then I go to C:\MinGW\msys\1.0\ folder in my pc, where msys.bat (to evoke the MinGW shell) and run it. Then on that bash screen, I navigated to the folder that I wanted to install initially. After that, using "./configure" and "make" worked just fine.
Actually, ./configure is not Linux-specific at all. Its original purpose was to smooth over the differences between the many variants of Unix now thankfully relegated to the dust heap of history, but nowadays it may well know how to set up things to work on Windows.
I would install the MinGW/MSYS development tools and see if the configure script is happy in that environment. (If that doesn't work, I can't help you any further.)
./configure is a script that comes with the source you have downloaded. You will use it the same on windows as you do on any other operating system. Unfortunately, you will need a posix-like shell to run it. A good option for that is to use mingw or cygwin
I'd say that this is program dependant. You see "configure" is a program/script in the local directory, it's not a global command/program (like "dir" would be)...
You either have luck to find something like "configure.bat" or "configure.cmd", or you'd have to adapt the configure-file into a BATCH-file.
You only run the ./configure command when building certain applications from source.
So Unzip it where you want to install it and then go to the folder where you unziped it and run "./configure"