# compilation error in mingw environment

8 messages
Open this post in threaded view
|

## compilation error in mingw environment

 Hi all, This is a follow on from a previous email. I have minGW (5.1.6), MSYS (1.0.11), and GSL (1.13) installed i am trying to compile a c script using the command: gcc -lgsl -lgslcblas GA-Groups.c -o Groups -Wall -O3 -DHAVE_INLINE I am on a windows xp sp3 machine I get the following compilation error: c:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lgsl collect2: ld returned 1 exit status anyone had this error or know which file is missing or even where it should be located or when it should have been made? Thanks in advance Andy -- Andy Beet Marine Policy Center MS #41 Woods Hole Oceanographic Institution MA 02543 Tel: 508-289-3376 Fax: 508-457-2184 email: [hidden email] ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________ MinGW-users mailing list [hidden email] A: Yes. > Q: Is it really? >> A: Because the logical conversation flow is disrupted. >>> Q: Why does MinGW object to top posting? (abstracted from Larry Hall signature) This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users
Open this post in threaded view
|

## Re: compilation error in mingw environment

 > gcc -lgsl -lgslcblas GA-Groups.c -o Groups -Wall -O3 -DHAVE_INLINE You have managed to get the command line arguments in almost completely reverse order from what is the norm.... The order does matter, especially for the -l options which should be *after* the .o (or .c) files that contain references to the libraries specified by the -l options. The more proper command line would be: gcc  -Wall -O3 -DHAVE_INLINE  -o Groups.exe GA-Groups.c  -lgsl -lgslcblas (That the location of the -l options doesn't matter on Linux is just an unfortunate coincidence that lets people to be sloppy and learn bad habits and pass these bad habits on to others. If you got the above from some tutorial, please contact the author and tell them to fix it.) > cannot find -lgsl You should also pass a -L option pointing to where the gsl library (import library) is located. (Presumably on Linux gsl is installed in a system default location and no -L optio is needed. But in general for each software package that contains libraries one should be prepared that it is installed in some arbitrary location and -L options are needed. It might for instance be that you on purpose have different versions of the package in different locations.) Nothing of this is MinGW- or GSL-specific, but fairly generic stuff. This is how Unix-style command-line compilers have always behaved. > anyone had this error or know which file is missing or even where it > should be located You should know yourself where you have installed the GSL library. --tml ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________ MinGW-users mailing list [hidden email] A: Yes. > Q: Is it really? >> A: Because the logical conversation flow is disrupted. >>> Q: Why does MinGW object to top posting? (abstracted from Larry Hall signature) This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users
Open this post in threaded view
|