[M3devel] new problem linking on NT386

Jay jayk123 at hotmail.com
Tue May 6 04:26:46 CEST 2008


-gui isn't quite working for you, for reasons I can't fully tell from here.
 
If -entry:WinMainCRTStartup, as you show, then link -dump -symbols _m3main.obj | findstr /i main should find WinMain, and not main. These two things must be altered together. Subsystem usually changes with them as well, but that's optional. WinMainCRTStartup calls WinMain, mainCRTStartup calls main, etc. (also with "w" prepended for Unicode/wide)
This is up to cm3 and cm3.cfg to cooperate on.
 
I can check tonight if it works for me. Could be some config file content missing.
It should generate WinMain instead of main.
 
You don't have the latest config because if you did, the link command you show below would list "hand.obj" among the list of files.
 
e.g.
 copy /y %cvsroot%\m3-sys\cminstall\src\config\nt386* \cm3\bin 
 copy /y \cm3\bin\NT386 \cm3\bin\cm3.cfg  
 
or:
 copy /y %cvsroot%\m3-sys\cminstall\src\config\* \cm3\bin 
 copy /y %cvsroot%\m3-sys\cminstall\src\config-no-install\* \cm3\bin 
 
The second form requires %cvsroot% to stick around and be findable by \cm3\bin\cm3.cfg, such as by setting CM3_ROOT.
The first form does not have such a requirement.
 
I'm really not super keen on supporting any config files other than the exact ones checked in.
Not even necessarily the ones produced by cminstall; I never use it.
I realize there are multiple reasonable modes of operation -- either using %PATH%, %INCLUDE%, and %LIB%, or using full paths in cm3.cfg. I use the first, so I can switch between toolsets more easily, and have no problem with spaces (which I don't have anyway), cminstall uses the second so that the result doesn't depend on the environment but it also has problems with spaces. Depending on short names like "progra~1" is just not the way imho.
 
 - Jay


Date: Mon, 5 May 2008 22:08:29 -0400From: rcoleburn at scires.comTo: m3devel at elegosoft.comSubject: Re: [M3devel] new problem linking on NT386

Jay:
 
No, I am using the -gui option in the m3makefile.  It is a windows gui application.
 
Here is the output of the command you suggested:
 
Microsoft (R) COFF/PE Dumper Version 9.00.21022.08Copyright (C) Microsoft Corporation.  All rights reserved.
 
Dump of file NT386\_m3main.obj
 
File Type: COFF OBJECT
 
COFF SYMBOL TABLE000 00000000 DEBUG  notype       Filename     | .file    _m3main.mc002 00000000 SECT1  notype       Static       | .text    Section length   50, #relocs    4, #linenums    7, checksum        0004 00000000 SECT2  notype       Static       | .data    Section length   10, #relocs    3, #linenums    0, checksum        0006 00000000 SECT3  notype       Static       | .bss    Section length    0, #relocs    0, #linenums    0, checksum        0008 00000000 SECT1  notype ()    External     | _main    tag index 0000000A size 00000050 lines 00000104 next function 0000000000A 00000000 SECT1  notype       BeginFunction | .bf    line# 0000 end 0000000000C 00000007 SECT1  notype       .bf or.ef    | .lf00D 00000050 SECT1  notype       EndFunction  | .ef    line# 000600F 00000000 SECT1  notype       Static       | TextSegment010 00000000 UNDEF  notype       External     | _Main_M3011 00000000 UNDEF  notype       External     | _RTLinker__InitRuntime012 00000000 UNDEF  notype       External     | _RTLinker__AddUnit013 00000000 UNDEF  notype       External     | _RTProcess__Exit014 00000004 SECT2  notype       Static       | T$14
 
String Table Size = 0x4B bytes
 
  Summary
 
           0 .bss          10 .data          50 .text
As you can see, I have an
   _main  and a
   _Main_M3
 
Not sure what you mean by saying I am missing hand.obj.  I have rebuilt everything using latest CVS update.  Please elaborate.
 
Regards,
Randy>>> Jay <jayk123 at hotmail.com> 5/5/2008 9:47 PM >>>Sounds like you missed the "gui" switch on the cm3 command lineor in the m3makefile -- in the m3makefile really.Putting it on the command line imho is only reasonable for thosesimple cases that don't have an m3makefile link -dump -symbols NT386\_m3main.obj | findstr /i main ?I expect you will have main or wmain, but not WinMain or wWinMain. Is this meant to be a gui app or a command line app?If it is meant to be a command line, then the problem is something else.  And I don't even want to explain..Can you send me the source? Also you are missing hand.obj here, so you don't have the potential pixmap fix. - Jay


Date: Mon, 5 May 2008 21:01:10 -0400From: rcoleburn at scires.comTo: m3devel at elegosoft.comSubject: [M3devel] new problem linking on NT386
I've rebuild my cm3 system using the latest sources.
 
I am now having a failure linking certain programs that used to build without problems.
 
I've listed the linker output from one of the programs below.  The issue seems to be an unresolved external symbol _WinMain at 16 .
 
Any ideas on what has changed and how to get this working again?
 
Microsoft (R) Incremental Linker Version 9.00.21022.08Copyright (C) Microsoft Corporation.  All rights reserved.
 
/out:CV_MessageTool.exe /subsystem:windows /entry:WinMainCRTStartup /nodefaultlib /debug /incremental:no /opt:ref /delayload:wsock32.dll /delayload:advapi32.dll /delayload:gdi32.dll /delayload:netapi32.dll /delayload:user32.dll /delayload:comctl32.dll delayimp.lib _m3main.obj iconRes.obj Resources.io Resources.mo Main.mo C:\cm3\pkg\windowsResources\NT386\windowsResources.lib C:\cm3\pkg\libSciRes3\NT386\libSciRes3.lib C:\cm3\pkg\stable\NT386\stable.lib C:\cm3\pkg\serial2\NT386\serial2.lib C:\cm3\pkg\netobj\NT386\m3netobj.lib C:\cm3\pkg\parseparams\NT386\m3parseparams.lib C:\cm3\pkg\formsvbt\NT386\m3formsvbt.lib C:\cm3\pkg\videovbt\NT386\videovbt.lib C:\cm3\pkg\jvideo\NT386\jvideo.lib C:\cm3\pkg\web\NT386\web.lib C:\cm3\pkg\tcp\NT386\m3tcp.lib C:\cm3\pkg\formsvbtpixmaps\NT386\m3formsvbtpixmaps.lib C:\cm3\pkg\vbtkit\NT386\m3vbtkit.lib C:\cm3\pkg\ui\NT386\m3ui.lib C:\cm3\pkg\libm3\NT386\m3.lib C:\cm3\pkg\m3core\NT386\m3core.lib winspool.lib comctl32.lib wsock32.lib comdlg32.lib netapi32.lib gdi32.lib user32.lib advapi32.lib kernel32.lib msvcrt.lib LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from wsock32.dllLINK : warning LNK4199: /DELAYLOAD:advapi32.dll ignored; no imports found from advapi32.dllLINK : warning LNK4199: /DELAYLOAD:gdi32.dll ignored; no imports found from gdi32.dllLINK : warning LNK4199: /DELAYLOAD:netapi32.dll ignored; no imports found from netapi32.dllLINK : warning LNK4199: /DELAYLOAD:user32.dll ignored; no imports found from user32.dllLINK : warning LNK4199: /DELAYLOAD:comctl32.dll ignored; no imports found from comctl32.dllmsvcrt.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain at 16 referenced in function ___tmainCRTStartupCV_MessageTool.exe : fatal error LNK1120: 1 unresolved externals
Regards,
Randy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080506/92775625/attachment-0002.html>


More information about the M3devel mailing list