Jump to page: 1 2
Thread overview
Linker commands generated by IDDE
Mar 02, 2004
Eliot
Mar 02, 2004
Arjan Knepper
Mar 02, 2004
Eliot
Mar 02, 2004
Arjan Knepper
Mar 03, 2004
Eliot
Mar 03, 2004
Arjan Knepper
Mar 03, 2004
Arjan Knepper
Mar 03, 2004
Eliot
Mar 03, 2004
Eliot
Mar 04, 2004
Scott Michel
Mar 04, 2004
Arjan Knepper
Library order affects program operation.
Mar 04, 2004
Eliot
Mar 05, 2004
Cesar Rabak
Mar 05, 2004
Walter
Mar 31, 2004
Jorge
Apr 01, 2004
chris elliott
Apr 02, 2004
Eliot
Apr 06, 2004
chris elliott
March 02, 2004
I asked this before as part of a question on the wxwindows group "Controls sample fails when linked using IDDE, OK using makefile."

but I got no answer.  I'm reposting here perhaps its more relevant

How do I find out what is in the @controls.LNK file generated by the IDDE, when it gets deleted after the run?  I can't find any IDDE option to preserve the temporary file.

I want to be able to compare the commands/options to those used by a Makefile, or to copy the commands into a makefile

regards

Eliot

March 02, 2004
Eliot wrote:
> I asked this before as part of a question on the wxwindows group "Controls sample fails when linked using IDDE, OK using makefile."
> 
> but I got no answer.  I'm reposting here perhaps its more relevant
> 
> How do I find out what is in the @controls.LNK file generated by the IDDE, when it gets deleted after the run?  I can't find any IDDE option to preserve the temporary file.
> 
> I want to be able to compare the commands/options to those used by a Makefile, or to copy the commands into a makefile
> 
> regards
> 
> Eliot
> 
The "output" window of the IDDE also shows the commandline.

Arjan
March 02, 2004
Arjan Knepper wrote:

> The "output" window of the IDDE also shows the commandline.

Thanks Arjan,

(Link to my original posting http://www.digitalmars.com/drn-bin/wwwnews?c%2B%2B.wxwindows/161)

It shows the following, but what is inside controls.LNK?

link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 /RC :controls.RES @controls.LNK

Error: No Match Found for Export/ENTRY -  : WinMainCRTStartup
Warning: USE16/USE32 Mismatch : DGROUP
Warning: 32-bit Segments Inappropriate for 16-bit Segmented output
Error: C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1): Cannot Reach TARGET from FRAME at Relative 00033H  from
C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  Segment _TEXT
C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  FRAME  = Frame of Group FLAT 0000
C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  TARGET = External Symbol ?Clear@wxListBox@@UAEXXZ (void syscall wxListBox::Clear(void )) 4AD30H
C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  FIXUPP Type = 32-bit Conditional JMP
Errors: 2  Warnings: 2
Build failed


thanks

Eliot

March 02, 2004
Eliot wrote:

> Arjan Knepper wrote:
> 
>> The "output" window of the IDDE also shows the commandline.
> 
> 
> Thanks Arjan,
> 
> (Link to my original posting http://www.digitalmars.com/drn-bin/wwwnews?c%2B%2B.wxwindows/161)
> 
> It shows the following, but what is inside controls.LNK?
> 
> link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 /RC :controls.RES @controls.LNK
> 
> Error: No Match Found for Export/ENTRY -  : WinMainCRTStartup
> Warning: USE16/USE32 Mismatch : DGROUP
> Warning: 32-bit Segments Inappropriate for 16-bit Segmented output
> Error: C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1): Cannot Reach TARGET from FRAME at Relative 00033H  from
> C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  Segment _TEXT
> C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  FRAME  = Frame of Group FLAT 0000
> C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  TARGET = External Symbol ?Clear@wxListBox@@UAEXXZ (void syscall wxListBox::Clear(void )) 4AD30H
> C:\APPS\WXWINVER\242CVS\SAMPLES\controls2\controls.OBJ(controls)  (1):  FIXUPP Type = 32-bit Conditional JMP
> Errors: 2  Warnings: 2
> Build failed
> 
> 
> thanks
> 
> Eliot
> 

I suspect you're using the wrong *.def file with this project. The .def file in the sample dir is probably for win16.

To avoid this create a project with a different name.

Arjan
March 03, 2004
Arjan Knepper wrote:

> I suspect you're using the wrong *.def file with this project. The .def file in the sample dir is probably for win16.

Thanks Arjan,

Yes the def file was part of the problem.
I moved it out of the way and now the link does not error.
However, the program doesn't run correctly.

I get an error dialog with
"the procedure entry point WSACleanup could not be located in the dynameic link library winmm.DLL"

To repeat myself (sorry bad NG style):
If I now delete the resultant EXE and use the makefile instead to ONLY do the link step, then the program runs fine.

C:\apps\wxwinver\242cvs\samples\controls2>make -f makefile.sc
link /co /DELEXECUTABLE /NOI /RC -L/exet:nt/su:windows controls.obj , controls.e
xe, controls, ..\..\lib\ wx_sc.lib  png_sc tiff_sc jpeg_sc zlib_sc shell32_sc ws
ock32_sc winmm32_sc advapi32 comctl32 comdlg32 ctl3d32 gc  gdi32 kernel32 ole32
oleaut32 snn user32 uuid

IDDE link:
link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 @controls.LNK

So, I am looking for a way to duplicate the link command/options used by the makefile in the IDDE.  (which appear to be inside the opaque controls.LNK)

thanks

Eliot

March 03, 2004
Eliot wrote:
> Arjan Knepper wrote:
> 
>> I suspect you're using the wrong *.def file with this project. The .def file in the sample dir is probably for win16.
> 
> 
> Thanks Arjan,
> 
> Yes the def file was part of the problem.
> I moved it out of the way and now the link does not error.
> However, the program doesn't run correctly.
> 
> I get an error dialog with
> "the procedure entry point WSACleanup could not be located in the dynameic link library winmm.DLL"
> 
> To repeat myself (sorry bad NG style):
> If I now delete the resultant EXE and use the makefile instead to ONLY do the link step, then the program runs fine.
> 
> C:\apps\wxwinver\242cvs\samples\controls2>make -f makefile.sc
> link /co /DELEXECUTABLE /NOI /RC -L/exet:nt/su:windows controls.obj , controls.e
> xe, controls, ..\..\lib\ wx_sc.lib  png_sc tiff_sc jpeg_sc zlib_sc shell32_sc ws
> ock32_sc winmm32_sc advapi32 comctl32 comdlg32 ctl3d32 gc  gdi32 kernel32 ole32
> oleaut32 snn user32 uuid
> 
> IDDE link:
> link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 @controls.LNK
> 
> So, I am looking for a way to duplicate the link command/options used by the makefile in the IDDE.  (which appear to be inside the opaque controls.LNK)
> 
> thanks
> 
> Eliot
> 

There is something wrong with your import libs (winmm). WSACleanup should be in WS2_32.lib/dll. Not in winmm.lib/dll.

Arjan.
March 03, 2004
Arjan Knepper wrote:

> Eliot wrote:
> 
>> Arjan Knepper wrote:
>>
>>> I suspect you're using the wrong *.def file with this project. The .def file in the sample dir is probably for win16.
>>
>>
>>
>> Thanks Arjan,
>>
>> Yes the def file was part of the problem.
>> I moved it out of the way and now the link does not error.
>> However, the program doesn't run correctly.
>>
>> I get an error dialog with
>> "the procedure entry point WSACleanup could not be located in the dynameic link library winmm.DLL"
>>
>> To repeat myself (sorry bad NG style):
>> If I now delete the resultant EXE and use the makefile instead to ONLY do the link step, then the program runs fine.
>>
>> C:\apps\wxwinver\242cvs\samples\controls2>make -f makefile.sc
>> link /co /DELEXECUTABLE /NOI /RC -L/exet:nt/su:windows controls.obj , controls.e
>> xe, controls, ..\..\lib\ wx_sc.lib  png_sc tiff_sc jpeg_sc zlib_sc shell32_sc ws
>> ock32_sc winmm32_sc advapi32 comctl32 comdlg32 ctl3d32 gc  gdi32 kernel32 ole32
>> oleaut32 snn user32 uuid
>>
>> IDDE link:
>> link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512 @controls.LNK
>>
>> So, I am looking for a way to duplicate the link command/options used by the makefile in the IDDE.  (which appear to be inside the opaque controls.LNK)
>>
>> thanks
>>
>> Eliot
>>
> 
> There is something wrong with your import libs (winmm). WSACleanup should be in WS2_32.lib/dll. Not in winmm.lib/dll.
> 
> Arjan.

The IDDE also creates a makefile, take a look in there to see what is going on.

Arjan
March 03, 2004
Thanks Arjan!

> The IDDE also creates a makefile, take a look in there to see what is going on.

Aha! Heres the answer I was looking for.
controls.LNK is a "here file" created inside controls.MAK

So I look in controls.mak, and see

$(LNK) $(LFLAGS) @<<$(PROJ).LNK
(various linker options and files - the info I want to know)
<<

Also I note that the makefile is for SMAKE.

(Maybe now that I know what I was looking for I can go back and find it in the documentation ;-)

- Eliot

March 03, 2004
What I found was that the order of libraries in the link command affects whether the program runs or not!

The IDDE generates this, the generated program has the error about WSACleanup

 ..\..\lib\ ..\..\LIB\tiff_sc.lib ..\..\LIB\wx_sc.lib ..\..\LIB\zlib_sc.lib COMCTL32.LIB COMDLG32.LIB ADVAPI32.LIB CTL3D32.LIB gc.lib OLE32.LIB OLEAUT32.LIB snn.lib UUID.LIB ..\..\LIB\shell32_sc.lib ..\..\LIB\winmm32_sc.lib ..\..\LIB\wsock32_sc.lib ..\..\LIB\jpeg_sc.lib ..\..\LIB\png_sc.lib KERNEL32.LIB GDI32.LIB USER32.LIB


If I just tweak the makefile by reordering the libraries, then the program runs!

..\..\lib\ ..\..\LIB\wx_sc.lib ..\..\LIB\tiff_sc.lib ..\..\LIB\zlib_sc.lib ..\..\LIB\jpeg_sc.lib ..\..\LIB\png_sc.lib ..\..\LIB\shell32_sc.lib ..\..\LIB\wsock32_sc.lib ..\..\LIB\winmm32_sc.lib  gc.lib OLE32.LIB OLEAUT32.LIB snn.lib UUID.LIB COMCTL32.LIB COMDLG32.LIB ADVAPI32.LIB CTL3D32.LIB KERNEL32.LIB GDI32.LIB USER32.LIB

Any tips on how I can get the IDDE to put the libraries in a good order?
(Or what else I am doing wrong of course)

thanks

Eliot

March 04, 2004
Eliot wrote:
> If I just tweak the makefile by reordering the libraries, then the program runs!

Look at the Project window, you should see a "your_project.PRJ" listed. Right click on it, click on "Edit Project...". You should get a new window listing the sources and libraries in the project.

Click on the "wsock32_sc.lib" line and then click on "Remove" to remove it.

Click on the line ABOVE "winmm32_sc.lib", then locate the wsock32_sc library again and add it to the project. It should now appear before winmm32_sc.lib

Unless someone else has a better way -- it's a pain, but it will work.


-scooter
« First   ‹ Prev
1 2