|
From: Per W. <pw...@ia...> - 2007-05-23 22:48:43
|
You seem to have missed the difference between include (header) files and linking to libraries. An include file only contains declarations of functions and variables that are available in a library or another source file. They may be included using "filename" or <filename>. If included using the <filename> form, the include files must be available in the compiler search path. If included using the "filename" form, they must be available in the current directory (or the directory specified in the file name). If you open the project settings, you can add more directories to scan for include files by adding one or more parameters: -I path among the compiler settings, where path is an extra directory to search for include (header) files. To actually link with a library, you must add the library to the project. If a library is called libgsl.a, you must open the project settings, and among the linker commands add a line containing: -lgsl This assumes that the library is in the compiler search path for libraries. You can defined more library search directories by adding one or more linker commands on the form: -L path where path is an extra directory to search for libraries to link with. In short: You haven't started to try to link with any library yet. You have only tried to compile code that requires a couple of include files. If one of your libraries have a header file lib.h, then you should either write a line: #include "lib.h" (if the file is in the current directory) #include "gsl/lib.h" (if the file is in the gsl subdirectory) #include "/gsl/lib.h" (if the file is in the /gsl directory) #include <lib.h> (if the file is in a configured include search directory) First when you have managed to compile all source files will Dev-C++ try to link any libraries to your application. /pwm On Wed, 23 May 2007, Vassily Shvets wrote: > Hello, > I'm interested in running codes that were developed in > connection with biological models. > > I'm hoping my question will be pertinent to others who > are also interested in mathematical modeling. > > Using Dev C++, and having followed all procedures(I > think) to link libraries(GSL, dislin and a couple of > others), and trying to compile a page of the > biological model code I referred to, the preprocessing > stage replies with "<lib.h>. No such file or > directory." This same reply occurs with whichever > library I want to link(except stdio.h). > > This also applies to linking of GSL math library, > thinking to try basic bits of script right from the > gsl reference manual, and thereby to progress in > knowledge about linking of libraries. Beyond having > followed directions for linking libraries for Dev C++, > and starting a new project and file then pasting a > program into the Dev C++ workspace, perhaps a very > basic description of the process of linking the GSL > library(and other libraries) for one of the GSL math > functions would benefit a number of people who would > like to do this? > > -shfets > > > > ____________________________________________________________________________________Ready for the edge of your seat? > Check out tonight's top picks on Yahoo! TV. > http://tv.yahoo.com/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |