This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5529: Output .DLL file from .C file - CCS 7.1.0.

Part Number: MSP430F5529
Other Parts Discussed in Thread: USB2ANY

Tool/software: Code Composer Studio

Howdy,

I am currently trying to output a dynamic library (.dll) from a .c file in CCS 7.1.0. I am using a wiki article as a reference to do this but I'm a bit confused on some of the steps. Specifically in the "Building a Dynamic Library" and "A Simple Example - hello.dll":

 The part I am confused about is circled below. I have added the __declspec(dllexport) <function> line into my .c file but I am not sure where or how to do this. In the section before "A Simple Example..." it says to do this in "the linker command line (or in a linker command file)" but I am not sure where that is.

Thanks,

Kevin

  • Just a bit of clarification...when I say "but I am not sure where or how to do this" in the second paragraph, the "this" I am referring to is the part circled in the picture.
  • Kevin Schmidgall said:
    Part Number: MSP430F5529

    I presume this is a typo.  You use cl6x, which is the compiler for the C6000 family of processors, not MSP430.  Dynamic linking is not supported for MSP430.

    Kevin Schmidgall said:
    In the section before "A Simple Example..." it says to do this in "the linker command line (or in a linker command file)" but I am not sure where that is.

    A linker command file is a text file that can be supplied on the linker invocation, just like an object file.  Among other things, it can contain command line options.  In some cases, it is more convenient to supply options in the command file, rather than on the command line.  This is likely to be the case if you have lots of --import or --export options you need to specify.

    In this particular case you could write a command file like this ...

    /* more_link_options.cmd */
    
    --import=printf
    --dynamic=lib
    -o hello.dll
    dl6x.6x
    -e start

    Then, an equivalent invocation of the compile and link would be ...

    %> cl6x -mv6400+ --abi=elfabi hello.c -z more_link_options.cmd

    Thanks and regards,

    -George

  • Thanks George,

    It isn't a typo, I just incorrectly assumed it would be possible with any processor/MCU in CCS.

    It's just a weird situation where I need a .dll file, to implement a function I have written in C, in LabVIEW. I just needed something that will output a .dll file. The reason I was using MSP430F5529 is because that is the MCU on the USB2ANY hardware.

    Regards,
    Kevin