1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Newbie question

Discussion in 'Plugins' started by Charles Dye, Feb 24, 2009.

  1. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Has anybody succeeded in creating plugins using MinGW? If so, can you give an example of how to compile into a working TC plugin?

    I was thinking, perhaps naively, that a simple

    Code:
    cpp PlugIn.cpp -o test.dll
    should work, but it doesn't. I get no error messages, but an enormous (700+ KB) .DLL which won't install via PLUGIN /L.
     
  2. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Paul, thank you for the help. As I understand it, you're using dlltool to create a replacement TakeCmd.lib? If I try a command like:

    Code:
    dlltool --kill-at --dllname c:\BIN\TCmd\TakeCmd.dll --output-def TakeCmd.def --output-lib TakeCmd.lib
    ... I get a 114-byte TakeCmd.def, and a 1,500-byte TakeCmd.lib, both of which seem awfully small to me (and still yield a huge, nonfunctional plugin). Are your file sizes similar?

    If GCC isn't a suitable tool, do you know of any free compiler which would be better for creating TCC plugins? I'm very much a newbie to C++, and trying to decipher all these compiler options and error messages is pretty frustrating to me....
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    On Wed, 25 Feb 2009 11:02:04 -0600, Charles Dye <> wrote:

    |Code:
    |---------
    |dlltool --kill-at --dllname c:\BIN\TCmd\TakeCmd.dll --output-def TakeCmd.def --output-lib TakeCmd.lib
    |---------
    |... I get a 114-byte TakeCmd.def, and a 1,500-byte TakeCmd.lib, both of which seem awfully small to me (and still yield a huge, nonfunctional plugin). Are your file sizes similar?
    |
    |If GCC isn't a suitable tool, do you know of any free compiler which would be better for creating TCC plugins? I'm very much a newbie to C++, and trying to decipher all these compiler options and error messages is pretty frustrating to me....

    MS has a free version of its compiler.
    --
    - Vince
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    That Visual Studio thing? I downloaded the Visual Basic once, and couldn't make it generate actual Windows executables; it seems only to create .NET apps. Is their C++ any better?
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    On Wed, 25 Feb 2009 11:22:06 -0600, Charles Dye <> wrote:

    |---Quote (Originally by vefatica)---
    |MS has a free version of its compiler.
    |---End Quote---
    |That Visual Studio thing? I downloaded the Visual Basic once, and couldn't make it generate actual Windows executables; it seems only to create .NET apps. Is their C++ any better?

    I use VC and avoid .NET completely. I don't know a lot about the free one. I've
    read it's non-optimizing (which I doubt matters much).
    --
    - Vince
     
  7. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    Download the free Visual C++ Express Edition 2008 from
    http://www.microsoft.com/express/vc/

    You can use it to create native apps as well as .Net apps.

    -Scott

    Charles Dye <> wrote on 02/25/2009 12:02:00 PM:


     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Thank you (and you too, Vince.) That looks like it will do the job.
     
  9. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
    The free Visual Studio 2008 C++ compiler is optimizing (it misses out some advanced stuff from the full product, like Profile Guided Optimization, but that's not critical).

    However, standalone compiled C programs generated by VS 2008 generally depend on the msvcrt9.dll C runtime, which is a problem for TCC plugins, as TCC itself doesn't use the CRT, so it doesn't initialise it (and the plugin crashes as a result).

    Paul.
     

Share This Page