I encountered the following problem:
I tried to compile & run a project (called UsingGSL) in Dev-C++ after
installation of Cygwin and obtained the following error:
Error 1
Compile & Run worked before - the problem occured after I tried to install a
Windows build of the library GiNaC, for which I installed Cygwin. I proceeded
as follows:
1) I installed Cygwin under drive d:/cygwin
2) I saved the file located under the link "tarball" (contains the GiNaC
library and further library files) from http://theor.jinr.ru/~varg/web/proj/ginac/woe32/
and unpacked it in a folder /GINAC
3) I opened the Cygwin shell, chenged into the /GINAC folder and typed
(according to the instructions on the above page):
export CPPFLAGS="-I/opt/ginac/include"
export PATH=$PATH:/opt/ginac/bin
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
Immediately after these 3 steps Dev-C++ did not work anymore for my project. A
similar thing happened before to me with this project. Here the problem was
that I had installed two different copies of mingw32. The problem was solved
by changing library directory under compiler options. Here however I have no
clue what to do. I tried to uninstall cygwin according to instructions under http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-
all,
where I only knew how to perform steps 3. Delete the Cygwin root folder and
all subfolders.
I don't know how to delete the cygwin system path, if I have set any at all
(?) At least in my environment variables under start->System proberties ->
advanced I don't find any entry of cygwin.
Does someone know how to fix the problem?
Thank you, Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
g++.exe: ../../../../Program Files/GnuWin32/lib/libgsl.a: No such file or
directory
g++.exe: ../../../../Program Files/GnuWin32/lib/libgslcblas.a: No such
file or directory
g++.exe: ../../../../Program Files/GnuWin32/lib/libgslcblas.dll.a: No such
file or directory
make.exe: *** Error 1
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I assume you are using Dev-C++ to develop and a makefile thru Cygwin to
compile and run.
It cannot find the library files in the linkjng phase. It should just be
looking just for gsl, etc. The "lib" prefix and the ".a" extension are not
needed, but it shouldn't matter if you have them. But is it linking to the
entire path ../../../../Program Files/GnuWin32/lib/ . This will override the
directory link -L"C:/MinGW/lib". Also, by not being contained in quotes, it
will not be able to find the file.
If you can't figure it out post your makefile. I hope its not the usual Linux
style makefile.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I assume you are using Dev-C++ to develop and a makefile thru Cygwin to
compile and run.
No, I only use Dev-C++. Before installation of Cygwin everything worked.
However I assume that during installation of Cygwin or GiNaC library something
happened which now causes the problems (please see my first post for a
description of the installation steps I performed).
It cannot find the library files in the linkjng phase. It should just be
looking just for gsl, etc. The "lib" prefix and the ".a" extension are not
needed, but it shouldn't matter if you have them. But is it linking to the
entire path ../../../../Program Files/GnuWin32/lib/ . This will override the
directory link -L"C:/MinGW/lib". Also, by not being contained in quotes, it
will not be able to find the file.
I noticed your files and libraries both are prefixed with -L. One of them
should have a different prefix.
I can't understand why everything worked before installation of cygwin, I
didn't change compiler options manually (maybe during installation this
happened automatically?) or the project itself. The ../../../../ paths are the
same as before, I once added them under ProjectOptions->Parameters (i.e. not
contained in quotes or leaving out the prefixes). The MinGW path instead of
the Dev-Cpp path appears due to the following reason: I have two copies of
mingw32, one in \MinGW and one in \Dev-Cpp. This caused error messages, so I
had to put the path C:/MinGW/lib under compiler options -> Directories . This
solved the problem.
If you can't figure it out post your makefile. I hope its not the usual
Linux style makefile.
Here's the content of Makefile.win, which is automatically produced by Dev-C++
:
The problem is the line:
LIBS = -L"C:/MinGW/lib" "../../../../Program Files/GnuWin32/lib/libgsl.a"
"../../../../Program Files/GnuWin32/lib/libgslcblas.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
I am not that familiar with Cygwin but the problem is probably the entry :
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
The file prefixes should be a lower case L, it may be an upper case i.
Or maybe the files should be in a different "export" statement.
You can also enter the path on the -l entry, e.g.
export LIBS="-l/opt/ginac/lib/libginac.a"
In this case the "lib" prefix and the ".a" extension are needed.
Check the documentation again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
problem is the line:
LIBS = -L"C:/MinGW/lib" "../../../../Program Files/GnuWin32/lib/libgsl.a"
"../../../../Program Files/GnuWin32/lib/libgslcblas.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
I don't think that this is the problem. This is really weird: another of my
projects which includes GSL in the same way still works as I just find out.
Here one finds exactly the same line in the make file:
Here the compile log, which is (apart from the project name and the sourcecode
name, and apart from the error message) exactly the same as for the one which
does not work:
Compiler: Default compiler
Building Makefile: "C:\Users\Martin\Programmierung\C++\DGL_GSL_1\Makefile.win"
Executing make...
make.exe -f "C:\Users\Martin\Programmierung\C++\DGL_GSL_1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-
Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-
Cpp/include" -I"C:/Users/Martin/Desktop/NumericalRecipes/NumericalRecipesThird
EditionSourceCodeCDROMv3.0/code" -I"C:/Program Files/GnuWin32/include"
The one that won't compile is:
"../../../../Program Files/GnuWin32/lib/libgsl.a"
The one that compiles is:
"../../../../../Program Files/GnuWin32/lib/libgsl.a"
There is one more "../".
Fix this and try again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you so much, this was the solution! Unbelievable. I have absolutely no
clue how the missing "../" could get lost?? I didn't change these paths
before, and I didn't move the directory /Program Files/GnuWin32 ... Do you
have an idea how this could have happened?
Best,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, a final remark: I installed cygwin and GiNaC again in the same way, and my
project still works. So this wasn't the reason then. Maybe I really got the
project in a different folder before and did not remember.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Final final remark: it definitely had nothing to do with Cygwin or GiNaC. You
are absolutely right, I must have had the project stored one directory lower -
I tried it out that coying the project into a directory higher exactly causes
the problem. Ok, very good, now that I understand the reason I feel relaxed
again ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I encountered the following problem:
I tried to compile & run a project (called UsingGSL) in Dev-C++ after
installation of Cygwin and obtained the following error:
Error 1
Compile & Run worked before - the problem occured after I tried to install a
Windows build of the library GiNaC, for which I installed Cygwin. I proceeded
as follows:
1) I installed Cygwin under drive d:/cygwin
2) I saved the file located under the link "tarball" (contains the GiNaC
library and further library files) from
http://theor.jinr.ru/~varg/web/proj/ginac/woe32/
and unpacked it in a folder /GINAC
3) I opened the Cygwin shell, chenged into the /GINAC folder and typed
(according to the instructions on the above page):
export CPPFLAGS="-I/opt/ginac/include"
export PATH=$PATH:/opt/ginac/bin
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
Immediately after these 3 steps Dev-C++ did not work anymore for my project. A
similar thing happened before to me with this project. Here the problem was
that I had installed two different copies of mingw32. The problem was solved
by changing library directory under compiler options. Here however I have no
clue what to do. I tried to uninstall cygwin according to instructions under
http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-
all,
where I only knew how to perform steps 3. Delete the Cygwin root folder and
all subfolders.
I don't know how to delete the cygwin system path, if I have set any at all
(?) At least in my environment variables under start->System proberties ->
advanced I don't find any entry of cygwin.
Does someone know how to fix the problem?
Thank you, Martin
P.S.: I should mention that the project includes the GSL library. Other
projects which contain a singe .cpp source are compiled without error.
And here's the compiler log. It seems that he does not find the GSL library
files. But before I installed cygwin everything was fine!
Compiler: Default compiler
Building Makefile: "C:\Users\Martin\Programmierung\C++\UsingGSL\Makefile.win"
Executing make...
make.exe -f "C:\Users\Martin\Programmierung\C++\UsingGSL\Makefile.win" all
g++.exe -c GSLExample1.cpp -o GSLExample1.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2"
-I"C:/Dev-Cpp/include"
-I"C:/Users/Martin/Desktop/NumericalRecipes/NumericalRecipesThirdEditionSourceCodeCDROMv3.0/code"
-I"C:/Program Files/GnuWin32/include"
g++.exe GSLExample1.o -o "UsingGSL.exe" -L"C:/MinGW/lib"
"../../../../Program Files/GnuWin32/lib/libgsl.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
g++.exe: ../../../../Program Files/GnuWin32/lib/libgsl.a: No such file or
directory
g++.exe: ../../../../Program Files/GnuWin32/lib/libgslcblas.a: No such
file or directory
g++.exe: ../../../../Program Files/GnuWin32/lib/libgslcblas.dll.a: No such
file or directory
make.exe: *** Error 1
Execution terminated
I assume you are using Dev-C++ to develop and a makefile thru Cygwin to
compile and run.
It cannot find the library files in the linkjng phase. It should just be
looking just for gsl, etc. The "lib" prefix and the ".a" extension are not
needed, but it shouldn't matter if you have them. But is it linking to the
entire path ../../../../Program Files/GnuWin32/lib/ . This will override the
directory link -L"C:/MinGW/lib". Also, by not being contained in quotes, it
will not be able to find the file.
If you can't figure it out post your makefile. I hope its not the usual Linux
style makefile.
I noticed your files and libraries both are prefixed with -L. One of them
should have a different prefix.
Hi, thanks for your help.
No, I only use Dev-C++. Before installation of Cygwin everything worked.
However I assume that during installation of Cygwin or GiNaC library something
happened which now causes the problems (please see my first post for a
description of the installation steps I performed).
I noticed your files and libraries both are prefixed with -L. One of them
should have a different prefix.
I can't understand why everything worked before installation of cygwin, I
didn't change compiler options manually (maybe during installation this
happened automatically?) or the project itself. The ../../../../ paths are the
same as before, I once added them under ProjectOptions->Parameters (i.e. not
contained in quotes or leaving out the prefixes). The MinGW path instead of
the Dev-Cpp path appears due to the following reason: I have two copies of
mingw32, one in \MinGW and one in \Dev-Cpp. This caused error messages, so I
had to put the path C:/MinGW/lib under compiler options -> Directories . This
solved the problem.
Here's the content of Makefile.win, which is automatically produced by Dev-C++
:
Project: UsingGSL
Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = GSLExample1.o $(RES)
LINKOBJ = GSLExample1.o $(RES)
LIBS = -L"C:/MinGW/lib" "../../../../Program Files/GnuWin32/lib/libgsl.a"
"../../../../Program Files/GnuWin32/lib/libgslcblas.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
INCS = -I"C:/Dev-Cpp/include" -I"C:/Program Files/GnuWin32/include"
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-
Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C
:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Users/Martin/Desktop
/NumericalRecipes/NumericalRecipesThirdEditionSourceCodeCDROMv3.0/code"
-I"C:/Program Files/GnuWin32/include"
BIN = UsingGSL.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before UsingGSL.exe all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "UsingGSL.exe" $(LIBS)
GSLExample1.o: GSLExample1.cpp
$(CPP) -c GSLExample1.cpp -o GSLExample1.o $(CXXFLAGS)
The problem is the line:
LIBS = -L"C:/MinGW/lib" "../../../../Program Files/GnuWin32/lib/libgsl.a"
"../../../../Program Files/GnuWin32/lib/libgslcblas.a" "../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
I am not that familiar with Cygwin but the problem is probably the entry :
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
The file prefixes should be a lower case L, it may be an upper case i.
Or maybe the files should be in a different "export" statement.
You can also enter the path on the -l entry, e.g.
export LIBS="-l/opt/ginac/lib/libginac.a"
In this case the "lib" prefix and the ".a" extension are needed.
Check the documentation again.
I don't think that this is the problem. This is really weird: another of my
projects which includes GSL in the same way still works as I just find out.
Here one finds exactly the same line in the make file:
Project: DGL_GSL_1
Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = main.o $(RES)
LINKOBJ = main.o $(RES)
LIBS = -L"C:/MinGW/lib" "../../../../../Program Files/GnuWin32/lib/libgsl.a"
"../../../../../Program Files/GnuWin32/lib/libgslcblas.a"
"../../../../../Program Files/GnuWin32/lib/libgslcblas.dll.a"
INCS = -I"C:/Dev-Cpp/include" -I"C:/Program Files/GnuWin32/include"
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-
Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C
:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Users/Martin/Desktop
/NumericalRecipes/NumericalRecipesThirdEditionSourceCodeCDROMv3.0/code"
-I"C:/Program Files/GnuWin32/include"
BIN = DGL_GSL_1.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before DGL_GSL_1.exe all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "DGL_GSL_1.exe" $(LIBS)
main.o: main.cpp
$(CPP) -c main.cpp -o main.o $(CXXFLAGS)
Here the compile log, which is (apart from the project name and the sourcecode
name, and apart from the error message) exactly the same as for the one which
does not work:
Compiler: Default compiler
Building Makefile: "C:\Users\Martin\Programmierung\C++\DGL_GSL_1\Makefile.win"
Executing make...
make.exe -f "C:\Users\Martin\Programmierung\C++\DGL_GSL_1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-
Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-
Cpp/include" -I"C:/Users/Martin/Desktop/NumericalRecipes/NumericalRecipesThird
EditionSourceCodeCDROMv3.0/code" -I"C:/Program Files/GnuWin32/include"
g++.exe main.o -o "DGL_GSL_1.exe" -L"C:/MinGW/lib" "../../../../../Program
Files/GnuWin32/lib/libgsl.a" "../../../../../Program
Files/GnuWin32/lib/libgslcblas.a" "../../../../../Program
Files/GnuWin32/lib/libgslcblas.dll.a"
Execution terminated
Compilation successful
What's going on here??
There is a difference in the library path.
The one that won't compile is:
"../../../../Program Files/GnuWin32/lib/libgsl.a"
The one that compiles is:
"../../../../../Program Files/GnuWin32/lib/libgsl.a"
There is one more "../".
Fix this and try again.
Thank you so much, this was the solution! Unbelievable. I have absolutely no
clue how the missing "../" could get lost?? I didn't change these paths
before, and I didn't move the directory /Program Files/GnuWin32 ... Do you
have an idea how this could have happened?
Best,
Martin
I don't know.
You may have installed the makefile or something one directory level lower or
higher.
Ok, a final remark: I installed cygwin and GiNaC again in the same way, and my
project still works. So this wasn't the reason then. Maybe I really got the
project in a different folder before and did not remember.
Final final remark: it definitely had nothing to do with Cygwin or GiNaC. You
are absolutely right, I must have had the project stored one directory lower -
I tried it out that coying the project into a directory higher exactly causes
the problem. Ok, very good, now that I understand the reason I feel relaxed
again ;)
Why are you using Cygwin?