Thread: Build errors with gsl_complex

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    12

    Build errors with gsl_complex

    Hi everyone! I need your help again!

    I need to work with complex numbers in a program of mine. I downloaded gsl and included gsl_complex.h and gsl_complex_math.h in my header.

    I can compile the program, but I cannot build it. Here's what I get:

    Undefined symbol gsl_complex_rect
    Undefined symbol gsl_complex_polar
    Undefined symbol gsl_complex_mul
    Undefined symbol gsl_complex_add
    Undefined symbol gsl_complex_mul_real

    How can they be undefined if I can compile the program???

    My compiler is Lab Windows CVI 6.0 on Windows XP SP2 and I tried to configure it for compatibility with MSVC and Borland TC but neither of them works.

    I tried on two different pcs.

    Thank you very much to all those who have read and a special thanks to those who will answer!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > How can they be undefined if I can compile the program???
    Because there are two different steps, and you don't normally see step 2 in the beginning.

    1. Your code is compiled. The compiler takes your source code, and information about HOW to call other functions from the header files you supply. If the compiler finds these, then your code will compile.

    2. Your object files are linked. The linker takes all the object files produced by the compiler, and links them with a bunch of standard libraries, and any specific libraries which you also specify.

    Because standard stuff is linked automatically, you don't see it happening.
    But what you need to do is find in something like "Project->Settings->Linker->Additional libraries", you specify where to find additional libraries, and names of additional libraries.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    12
    You mean I need .lib files? I think you don't, you meant library in general, didn't you?

    Ok, I have to find that setting.

    Thank you very much!

    I'm trying right now!

    Thanks!

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    12
    I couldn't solve my problem. There are no linker settings. There are "Build Options" and "Include Paths" but it's not what I'm looking for.

    Thank you very much all the same!
    Bye!

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    15
    3 years later, a solution has come.. you need to use Dev-C++ compiler, along with the setting from here:
    http://www.quantcode.com/modules/sma...q.php?faqid=10

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  2. Header File Errors...
    By Junior89 in forum C++ Programming
    Replies: 5
    Last Post: 07-08-2007, 12:28 AM
  3. Visual C++
    By gvector1 in forum Windows Programming
    Replies: 20
    Last Post: 03-14-2003, 11:37 AM
  4. executing errors
    By s0ul2squeeze in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 01:43 PM