NO

Author Topic: porting from LccWin32  (Read 5999 times)

Steve A.

  • Guest
porting from LccWin32
« 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/ 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.


CommonTater

  • Guest
Re: porting from LccWin32
« Reply #1 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.


Online AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: porting from LccWin32
« Reply #2 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.
best regards
 Alex ;)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: porting from LccWin32
« Reply #3 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.
May the source be with you

Steve A.

  • Guest
Re: porting from LccWin32
« Reply #4 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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: porting from LccWin32
« Reply #5 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"
May the source be with you

Steve A.

  • Guest
Re: porting from LccWin32
« Reply #6 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