I've installed boost-1.68.0 under windows into "C:\boost". When I try to compile simple program using boost/geometry.hpp, mingw throws an error:
fatal error: boost/geometry.hpp: No such file or directory
I've tried this:
g++ example.cpp -o example.exe -I"C:\boost\include\boost-1_68" -L"C:\boost\lib"
It appeared that installation of boost was not completed properly despite of the fact that no errors was showed during the process.
There were no *.hpp files in "C:\boost\include" directory, just the structure of empty folders.
The problem was solved by manually coping same boost folder with *.hpp from downloaded install package.
Related
I'm trying to compile a C program using Ncurses on Windows. I compiled it successfully using GCC and it works perfectly if I run it in Cygwin or MSYS2. However, if I try to run it in the Windows Command Prompt, I get this error:
Error opening terminal: xterm-256color.
Is it possible to compile it to run using the native Windows console? This is how I've been compiling it:
gcc -o PROGRAMNAME main.c -lncurses
I also have the Cygwin and Msys dlls for Ncurses copied into the directory of the compiled executable.
Update
So I figured out how to get the program to run. I deleted all the DLLs from the project folder and then added "C:\msys64\usr\bin" to my PATH environment variable. However, I would still like to know if there's a way to get this to work if I were to distribute it, since it's still relying on my installation of MSYS2.
Update 2
Gave up and just used pdcurses and it works fine.
Update 3
Nevermind, found a solution! See below.
I figured out a solution. I'll post it here in case anyone else has this same issue. Thanks to Thomas Dickey for your help!
Install the mingw-w64 toolchain and any other packages you need to compile your project (this is mostly where I messed up)
Make sure to include the /mingw64/include/ncurses directory when compiling, or else gcc won't be able to find curses.h
Include /mingw64/bin as a static directory or copy over the necessary dlls to the same folder as the directory
I ended up with this to compile:
gcc -I/mingw64/include/ncurses -o PROGRAMNAME main.c -lncurses -L/mingw64/bin -static
I get this error when I'm using Cygwin on a "makefile":
"boost/filesystem.hpp: No such file or directory compilation terminated."
This is everything that's inside the "makefile":
mnisten: src/main.cpp g++ -Wall -O2 -lboost_filesystem-mt -std=c++0x -o mnisten src/main.cpp
And inside the "main.cpp" file, this is the line of code that the error message is referring to:
#include <boost/filesystem.hpp>
First I tried to put the "boost" folder (containing "filesystem.hpp") inside the "src" folder, but the error message was unchanged, I still got the same error message.
Then I changed the "include" code inside "main.cpp" to:
#include <filesystem.hpp>
I also copied the "filesystem.hpp" file into the root of the "src" folder, and surprisingly this worked. I got a new error, but I got past the "include" part.
I find it very confusing that it I get an error when the file is in a folder, but when it is in the root of the "src" folder it works.
Any suggestions on how I can get it to work when the file is inside the "boost" folder?
(I downloaded the the "filesystem.hpp" since it was not included)
To find the cygwin package that contains a given file you can use cygcheck -p
$ cygcheck -p boost/filesystem.hpp
Found 6 matches for boost/filesystem.hpp
libboost-devel-1.60.0-1 - libboost-devel: Boost C++ libraries (installed binaries and support files)
libboost-devel-1.60.0-2 - libboost-devel: Boost C++ libraries (installed binaries and support files)
mingw64-i686-boost-1.60.0-1 - mingw64-i686-boost: Boost C++ libraries for Win32 toolchain (installed binaries and support files)
mingw64-i686-boost-1.60.0-2 - mingw64-i686-boost: Boost C++ libraries for Win32 toolchain (installed binaries and support files)
mingw64-x86_64-boost-1.60.0-1 - mingw64-x86_64-boost: Boost C++ libraries for Win64 toolchain (installed binaries and support files)
mingw64-x86_64-boost-1.60.0-2 - mingw64-x86_64-boost: Boost C++ libraries for Win64 toolchain (installed binaries and support files)
so you need to install libboost-devel as you are not crosscompiling for mingw64.
Similar for
$ cygcheck -p opencv/cv.hpp
Found 1 matches for opencv/cv.hpp
libopencv-devel-2.4.11-1 - libopencv-devel: Real-time computer vision library (development) (installed binaries and support files)
Probably you don't have any boost installed in your system. I got this error and solved by installing it.
sudo apt-get install libboost-all-dev
Problem is actually that my compiler doesn't find the SDL library files. I rounded down possible errors by removing all SDL files, reinstalling SDL and compiling without SDL_image. No help.
Files I copied from SDL-devel-1.2.15-mingw32.tar.gz package:
sdl\include to mingw\include\sdl (I later copied files to mingw\include root as well)
sdl\lib to mingw\lib (3 files: libSDL.dll.a libSDLmain.a and libSDL.la)
sdl.dll and sdl-config to mingw\bin
I installed it via msys, and later manually just to make sure, and also copied same files to corresponding places in msys folder.
The error message:
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL
I have been using a simple make command in msys console, I moved the options for build into makefile to make things easier.
I'm using WinXP, MinGW/MSYS, SDL 1.2.15 and trying to compile fheroes2 source code.
I am installing glfw forcodeblocks, when I try to execute the makefile through command prompt in order to compil glfw using this command:mingw32-make win32-mingw I get the following error mingw32 make: ***no rule to make target 'win32'. stop.
I am running a 64 bit version of windows 8
Edit:
For newer versions of glfw you can not use compile.bat or command mingw32-make win32-mingw
You must use CMake to create makefiles under the source folder e.g. build folder.
Then you can run mingw32-make .
For older versions :
Try it with the command described on the glfw side.
Unzip the archive anywhere you like (I will assume C:\glfw for simplicity).
Compile:
For Windows users, there is a batch file which allows to compile using a variety of compilers.
Open a DOS window, cd to the directory where GLFW lives (e.g. C:\glfw), and type
compile make mgw
Building the Libraries
As you can see there is a compile.bat
Of course you have to cd to your source folder. From an folder outside the source a compile.bat will not work.
if in your source there is no compile download it here.
glfw-2.5.zip
I have installed MinGW in Windows Vista, so I can use gcc but it doesn't work.
When I try to compile a .c file like gcc hello.c -o hello.exe I get an error (translated):
cc1.exe: could not find libmpc-2.dll
How can I fix this?
I had the same problem. Installing the mpc package with mingw-get solved it for me.
Open a command line window
Go to your MinGW\bin directory: e.g. cd MinGW\bin
execute: mingw-get install mpc
I have today same problem in Windows 7. All DLL's was in folder with MinGW. Only copying DLL's in SYSTEM32 folder solved this
Copy this file into the directory where your gcc executable can be found (the one named bin).
http://www38.zippyshare.com/v/95754574/file.html
The strange thing is that the MinGW installation of mine included this dll correctly.