[Distutils] 4Suite bcpp build looking for WinMain

Eric Hanson eric@aquameta.com
Fri Aug 16 15:26:05 2002


Jeremy Kloth (jeremy.kloth@fourthought.com) wrote:
> Eric Hanson wrote:
> > running build_scripts
> > build\temp.win32-2.2\scripts\4odb.c:
> > Warning W8004 build\temp.win32-2.2\scripts\4odb.c 16: 'i' is assigned
> > a value that is never used in function main
> > Error: Unresolved external 'WinMain' referenced from
> > C:\BCC55\LIB\C0W32.OBJ
> > error: command 'ilink32.exe' failed with exit status 2
> >
> > Any ideas what might be wrong?  It's like it thinks it's a Windows
> > application, but I tried adding the -TC flag to bcppcompiler.py in the
> > self.compile_options, no dice.
> >
> 
> Actually, our scripts are Windows applications.  Our build_scripts command
> uses .link_executable method on the compilier to create them.  I'd suggest
> looking there to see if the correct options are used for building an
> application use Borland's tools.  I don't think too many people use that
> feature of the compiliers so it could be wrong.

Hmm, still haven't figured it out.  Here's the code you're refering to.

# Now compile and link it
objects = self.compiler.compile([source],
    output_dir=self.build_temp,
    debug=self.debug,
    )
self.compiler.link_executable(objects, progname,
    output_dir=self.build_dir,
    debug=self.debug,
    )

I tried adding the -W flag for a windows target as both a extra_prearg
and extra_postarg in compiler.compile ().  Didn't help.

Here's the link_executable syntax:

link_executable(self, objects, output_progname, output_dir=None,
libraries=None, library_dirs=None, runtime_library_dirs=None, debug=0,
extra_preargs=None, extra_postargs=None) from
distutils.ccompiler.CCompiler

Any ideas?

Thanks,
Eric