Newbie question

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

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,379
39
Albuquerque, NM
prospero.unm.edu
#1
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.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,379
39
Albuquerque, NM
prospero.unm.edu
#3
It's not trivial, mainly because Rex doesn't distribute gcc-compatible libraries. My lua4nt plugin (http://code.google.com/p/lua4nt/) is built with mingw - for the specifics, you can look at the GCC build script which is visible at http://code.google.com/p/lua4nt/source/browse/trunk/buildgcc.btm
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
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
 
#6
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
 

samintz

Scott Mintz
May 20, 2008
1,203
11
Solon, OH, USA
#7
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:


> ---Quote (Originally by p.f.moore)---
> It's not trivial, mainly because Rex doesn't distribute gcc-
> compatible libraries. My lua4nt plugin (http://code.google.com/p/lua4nt/
> ) is built with mingw - for the specifics, you can look at the GCC
> build script which is visible at http://code.google.
> com/p/lua4nt/source/browse/trunk/buildgcc.btm
> ---End Quote---
> 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....
>
>
>
>
 
May 30, 2008
122
1
#9
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).
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.