How to compile and link koolplot?

This is a discussion on How to compile and link koolplot? within the Linux Programming forums, part of the Platform Specific Boards category; Hello everybody, I am a a newbie in c++ and need to use the koolplot library, but I am not ...

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    2

    Unhappy How to compile and link koolplot?

    Hello everybody,

    I am a a newbie in c++ and need to use the koolplot library, but I am not sure how to compile and link a basic program.

    I am using the a unix terminal (command line) and the g++ compiler.
    In the past I have linked to (for example) the fftw library with this command

    g++ -Wall myprogram.cpp /usr/lib/libfftw3.a -o myprogram

    So I figure I would only need to change the "/usr/lib/..." part with the location of the koolplot.a file. But that does not work.

    Additionally, I have only tried that with the already built version given in the website (codecutter.org/tools/koolplot/). I see that there is also source code for those who plan to rebuild koolplot. But I am not sure what that means. (And I am guessing I may have to do that)

    Thanks in advance for any help you can give me

  2. #2
    Registered User inequity's Avatar
    Join Date
    Nov 2010
    Location
    Seattle, Washington
    Posts
    59
    To quote the koolplot website (though pardon me if this doesn't work):

    Command line compilation:

    Compile with:
    gcc.exe -x c++ -mwindows -o aplot.o aplot.c

    Link with:
    gcc.exe -mwindows -o aplot.exe aplot.o -lkoolplot
    -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -lstdc++ -lsupc++

  3. #3
    Registered User inequity's Avatar
    Join Date
    Nov 2010
    Location
    Seattle, Washington
    Posts
    59
    and in the above example I mean that you compile your code (in the example aplot.c) into an object (example's aplot.o), and then link and output it into an exe (aplot.exe in example) with the linker switches

  4. #4
    Registered User
    Join Date
    Feb 2011
    Posts
    2
    Thank you for your reply inequity.
    I did see the code you posted on the koolplots website, however, I believe that requires I use gcc.exe which I do not have on my ubuntu os. I was hoping to find a solution using the g++ compiler. Do you have any idea how to compile let's say the aplot.cpp code with g++?

    Thanks again

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,418
    GCC compiles C and C++

    gcc.exe invokes the C compiler
    g++.exe invokes the C++ compiler

    Try it, and post error messages if it doesn't work.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me please.
    By yann in forum C Programming
    Replies: 15
    Last Post: 09-29-2009, 09:04 PM
  2. Compile and Link tutorials
    By tapti in forum C Programming
    Replies: 12
    Last Post: 08-04-2009, 03:23 AM
  3. I need help to compile this code...
    By wise_ron in forum C Programming
    Replies: 17
    Last Post: 05-07-2006, 12:22 PM
  4. Link Error
    By Luigi in forum C++ Programming
    Replies: 1
    Last Post: 04-12-2004, 07:12 PM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 04:29 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21