Results 1 to 4 of 4

Thread: Problems linking gsl 2.1

  1. #1
    Join Date
    Jun 2017
    Posts
    2
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Problems linking gsl 2.1

    I'm using Qt 5.8 and gsl 2.1 (compiled with cygwin64), this is what i use in the .pro file to link gsl:

    INCLUDEPATH+=C:/gsl/include/
    INCLUDEPATH += C:/gsl/LIBS
    LIBS += -LC:/gsl/lib -lgsl -lgslcblas -lm

    when i include the headers and compile i don't have any problem even when i declare and object, but when i tray to use any function i got this error:

    C:\Users\CIFAS-1\untitled4\mainwindow.cpp:9: error: undefined reference to `gsl_matrix_alloc'.

    Please any one has some idea?

  2. #2
    Join Date
    Jun 2017
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problems linking gsl 2.1

    Have you tried putting an environment extern "C" around the function declarations in your gsl header file?
    Qt Code:
    1. extern "C" {
    2. ...
    3. gsl_matrix_alloc();
    4. ...
    5. }
    To copy to clipboard, switch view to plain text mode 

    It's only a guess. I just saw that in gsl_matrix_double.h from the GSL source, this actually should already be declared in C++.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems linking gsl 2.1

    compiled with cygwin64
    And is your app also built with the gcc compiler from your cygwin distro? From the error message, this looks like a Visual Studio linker error. The two compilers are incompatible - you must build all binaries with either one or the other, can't mix and match.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #4
    Join Date
    Jun 2017
    Posts
    2
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Problems linking gsl 2.1

    No my app was built with the mingw compiler from Qt (the deafult compiler) in windows

Similar Threads

  1. Problems linking gsl with Qt
    By dtallart in forum Qt Programming
    Replies: 2
    Last Post: 9th July 2011, 08:35
  2. problems with linking.... ??
    By thejester in forum Qt Programming
    Replies: 3
    Last Post: 10th July 2009, 21:35
  3. Linking problems with QT4 under Windows
    By Ancalagon in forum Qt Programming
    Replies: 2
    Last Post: 8th September 2008, 14:29
  4. Static linking problems.
    By Unplugged in forum Newbie
    Replies: 8
    Last Post: 17th February 2008, 03:25
  5. Replies: 3
    Last Post: 30th January 2006, 16:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.