Pelles C forum

Pelles C => General discussions => Topic started by: Steve A. on October 31, 2010, 02:25:45 AM

Title: porting from LccWin32
Post by: Steve A. on October 31, 2010, 02:25:45 AM
I'm porting an existing LccWin32 project to Pelles C and have encountered what could be a "deal killer".
My project is a scripting engine and I use Dyncall http://www.dyncall.org/ (http://www.dyncall.org/) for making dynamic DLL calls during runtime.

When I compile, Pelles-C gives this error message:

POLINK: fatal error: File not found: 'LIBCMT.lib'.


Now, if I add LIBCMT.lib (from VC) to the \pellesc\LIB\ directory, I get a bunch of "redefinition" error messages:

POLINK: error: Symbol '___argc' is multiply defined: 'crt.lib(_crt0dat.obj)' and 'libcmt.lib(crt0dat.obj)'.
POLINK: error: Symbol '___argv' is multiply defined: 'crt.lib(_crt0dat.obj)' and 'libcmt.lib(crt0dat.obj)'.
POLINK: error: Symbol '___wargv' is multiply defined: 'crt.lib(_crt0dat.obj)' and 'libcmt.lib(crt0dat.obj)'.
POLINK: error: Symbol '_exit' is multiply defined: 'crt.lib(exit.obj)' and 'libcmt.lib(crt0dat.obj)'.
etc...etc...etc...


I have isolated it to the Dyncall LIB files.
What I don't understand is that, LccWin32 does not appear to use LIBCMT.lib either and yet produces no such error.
At least I can't find it anywhere.

Any ideas ?

Thanks,
Steve A.

Title: Re: porting from LccWin32
Post by: CommonTater on October 31, 2010, 07:55:20 AM
Look in the headers for your dyncall library... is there a #pragma comment(lib, "libcmt.lib") in there?  If so try commenting it out.

Title: Re: porting from LccWin32
Post by: AlexN on October 31, 2010, 11:27:19 AM
POLINK: fatal error: File not found: 'LIBCMT.lib'.
This sounds for me like the crtmt.lib (C runtime multi threat) from Pelles C.
Title: Re: porting from LccWin32
Post by: TimoVJL on October 31, 2010, 12:29:37 PM
Quote
POLINK: fatal error: File not found: 'LIBCMT.lib'.
You can try to use linker option -nodefaultlib (Ignore standard places)
and add  crtmt.lib to linker library files.
Title: Re: porting from LccWin32
Post by: Steve A. on November 01, 2010, 01:42:27 AM
Look in the headers for your dyncall library... is there a #pragma comment(lib, "libcmt.lib") in there?  If so try commenting it out.
I looked thru the headers..., no mention of libcmt.lib.

This sounds for me like the crtmt.lib (C runtime multi threat) from Pelles C.
You can try to use linker option -nodefaultlib (Ignore standard places) and add  crtmt.lib to linker library files.

Ok, I made these adjustments and it seems to have solved the problem.
I still don't know why it was trying to grab libcmt.lib even though I can't find it listed anywhere.

Thanks guys.
Steve A
Title: Re: porting from LccWin32
Post by: TimoVJL on November 01, 2010, 07:12:09 AM
Quote
I still don't know why it was trying to grab libcmt.lib even though I can't find it listed anywhere.
It can come from lib with directive /DEFAULTLIB:"LIBCMT"
Title: Re: porting from LccWin32
Post by: Steve A. on November 01, 2010, 03:21:07 PM
It can come from lib with directive /DEFAULTLIB:"LIBCMT"

Hmm...,
I think you are right.

Thanks Timo,
Steve A