cygwin correct setup great full installation and proper usage features

Respect deep joyfully express universal!
Installed on the new cygwin disk; I try to compile ie actually test, I play

Дмитро@Komp /cygdrive/f/HeloWorld
$ g++ ublas_test.cpp -o ublas_test
ublas_test.cpp:1:42: fatal error: boost/numeric/ublas/vector.hpp: No such file or directory
#include <boost/numeric/ublas/vector.hpp>
compilation terminated.

I test cygwin, I try to compile. Why is my cygwin installed incorrectly?
Please explain to me how to set it up correctly.


#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

using namespace boost::numeric::ublas;

// "y = Ax" приклад
int main()
    vector<double> x(2);
    x(0) = 1; x(1) = 2;

    matrix<double> A(2,2);
    A(0,0) = 0; A(0,1) = 1;
    A(1,0) = 2; A(1,1) = 3;

    vector<double> y = prod(A, x);

    std::cout << y << std::endl;

    return 0;

But he can not find the files that exactly are there? What else is he? setup-x86 itself installed the files
In some directories, I have not corrected anything there.

Help me set up or install cygwin correctly!
I either do not understand or I can not download it correctly.
How do I fix the curve?
Ask me clarifying questions. Point me to resources where the right information is different.
Powerful request for help, about how you need a guide!

Last edited on
Do you have the boost library files installed? Can you see them on your hard drive? Can you see the files


on your hard drive?
Yes, I see the files. They are on the hard disk.

I see these files for sure, but maybe there are no other parts of the boost. I set the checkboxes correctly when installing cygwin, waited until the installation was completed, and did not take any more steps.
Last edited on
If you change your build line to tell the compiler where to look for include files, what happens?

So for example, if you have the files arranged like this:


and you change your build line to:

g++ -IC:/some/directory ublas_test.cpp -o ublas_test

so that you're telling the compiler to look for include paths in the directory containing your boost directory, what happens?

I see these files for sure, but maybe there are no other parts of the boost

The problem is simply that the compiler cannot find, in all the directories in which it is searching, the file named vector.hpp at path boost/numeric/ublas/. If that file does exist, as you say it does, and it does have that path, then the problem is only that the compiler doesn't know where to look.
Last edited on
I probably did not understand exactly what to do.

Дмитро@Komp /usr/bin
$ g++ -IF:\HeloWorld ublas_test.cpp -o ublas_test
g++.exe: error: ublas_test.cpp: No such file or directory

Дмитро@Komp /usr/bin
$ g++ -If:\HeloWorld ublas_test.cpp -o ublas_test
g++.exe: error: ublas_test.cpp: No such file or directory

Дмитро@Komp /usr/bin
$ g++ -I f:\HeloWorld ublas_test.cpp -o ublas_test
g++.exe: error: ublas_test.cpp: No such file or directory

Дмитро@Komp /usr/bin
$ g++ -I f:/HeloWorld ublas_test.cpp -o ublas_test
g++.exe: error: ublas_test.cpp: No such file or directory

Дмитро@Komp /usr/bin
$ g++ -IF:/HeloWorld ublas_test.cpp -o ublas_test
g++.exe: error: ublas_test.cpp: No such file or directory

Дмитро@Komp /usr/bin

@Repeater is on the right track here.

@Dmytro, did you run the boost install for you compiler?

Boost as a lot of header only libraries that don't really require an install, except for the setup of the include directory "Boost", and something in Boost's own internals which "sets" the compiler when required.

I don't use Cygwin myself, but in other installations I often must run Boost's setup/build just to get Boost configured for the compiler I'm using.

In your case, so far, the error looks to be merely "boost" is not known to the compiler as one of the include directories to search through, which could be a project configuration issue (your makefile or IDE pointing to include directories), or perhaps some environment variable pointing to the boost includes (which some project configurations use so as to be 'universal').

g++.exe: error: ublas_test.cpp: No such file or directory

THis is a different problem now.

Now the problem is that the compiler cannot find the file ublas_test.cpp

I bet this is because you are running g++ in the directory /usr/bin but the file ublas_test.cpp is NOT in that directory.

If you're going to tell your compiler to use the file ublas_test.cpp, the compiler needs to be able to find that file.

Previously, you were running g++ from the directory
and the compiler could find the file ublas_test.cpp
Thanks so much everyone very much!

I've been very googled here for a long time.

That's what I found, probably using the wrong compiler.
I don’t know how to set the path settings correctly, where to do it, and how different compilers would conflict. Thankful advice!

Дмитро@Komp /usr/bin
$ gcc --print-search-dirs
install: D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/
programs: =D:/MinGW/bin/../libexec/gcc/mingw32/5.1.0/;D:/MinGW/bin/../libexec/gcc/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/mingw32/5.1.0/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/
libraries: =D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/;D:/MinGW/bin/../lib/gcc/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/lib/mingw32/5.1.0/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/lib/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../mingw32/5.1.0/;D:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../

Дмитро@Komp /usr/bin

That is, cygwin is in F: \ Cygwin2
Last edited on
Go to directory /cygdrive/f/HeloWorld

Enter this command: ls

Tell us what it says.

You do have the correct boost headers installed.
You do have g++.
You do have your source code file ublas_test.cpp.

You just keep running the compile command in the wrong directory.

When you run the compile command, you're doing it from places that the compiler cannot see all the files. That's it. That's the mistake you're making.

You're just running the command without telling the compiler where to find all the files.

Where on your hard drive is the boost file vector.hpp ? I want to just tell you what command to enter, in which directory, but we need to know where the files are on your hard drive.
Last edited on
ls prints a lot of different files like
$ ls
4ti2gmp.exe cygopencv_ocl-2.4.dll
4ti2int32.exe cygopencv_optflow-3.2.dll
4ti2int64.exe cygopencv_optflow-3.4.dll
ESingular.exe cygopencv_phase_unwrapping-3.2.dll
Magick ++ - config cygopencv_phase_unwrapping-3.4.dll
Magick-config cygopencv_photo-2.4.dll
MagickCore-config cygopencv_photo-3.2.dll
MagickWand-config cygopencv_photo-3.4.dll
Shape_PointInPoly.exe cygopencv_plot-3.2.dll


Last edited on
Does ls show you that the file ublas_test.cpp IS in the directory F:\HeloWorld\ ?

If it does, then running this command, in directory F:\HeloWorld\, is what you want:

g++ -IF:/Cygwin2/usr/include ublas_test.cpp -o ublas_test

That command WILL find the header files, because that command is telling the compiler to look in location F:/Cygwin2/usr/include for the file boost/numeric/ublas/vector.hpp.

That command WILL find the file ublas_test.cpp because that file is in the directory in which you are running the command, so long as you ARE running the command in directory F:\HeloWorld\ and that directory does contain the file ublas_test.cpp
Thank you!! That's an understandable explanation. Now the simplicity of clarity was felt.But here are the following errors now

Дмитро@Komp /cygdrive/f/HeloWorld
$ g++ -IF:/Cygwin2/usr/include ublas_test.cpp -o ublas_test
In file included from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/mingw32/bits/gthr.h:148:0,
from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ext/atomicity.h:35,
from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/bits/ios_base.h:39,
from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ios:42,
from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ostream:38,
from D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/iterator:64,
from F:/Cygwin2/usr/include/boost/operators.hpp:98,
from F:/Cygwin2/usr/include/boost/serialization/strong_typedef.hpp:27,
from F:/Cygwin2/usr/include/boost/serialization/collection_size_type.hpp:10,
from F:/Cygwin2/usr/include/boost/serialization/array_wrapper.hpp:22,
from F:/Cygwin2/usr/include/boost/serialization/array.hpp:26,
from F:/Cygwin2/usr/include/boost/numeric/ublas/storage.hpp:21,
from F:/Cygwin2/usr/include/boost/numeric/ublas/vector.hpp:21,
from ublas_test.cpp:1:
D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/mingw32/bits/gthr-default.h: In function 'int __gthread_yield()':
D:/MinGW/lib/gcc/mingw32/5.1.0/include/c++/mingw32/bits/gthr-default.h:694:33: error: 'sched_yield' was not declared in this scope
return __gthrw_(sched_yield) ();
Let me have a code in my computer that lies in unknown places. And I want to see it, and I want to read in it, what is return __gprw_(sched_yield) (); who they are and what they are and how they are declared. How am I supposed to do that? What are the ways to do this?
Registered users can post here. Sign in or register to post.