www.digitalmars.com         C & C++   DMDScript  

c++.idde - Linker commands generated by IDDE

reply Eliot <eblennerhassett audioscience.com> writes:
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
Mar 02 2004
parent reply Arjan Knepper <arjan ask.me> writes:
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
Mar 02 2004
parent reply Eliot <eblennerhassett audioscience.com> writes:
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
Mar 02 2004
parent reply Arjan Knepper <arjan ask.me> writes:
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
Mar 02 2004
parent reply Eliot <eblennerhassett audioscience.com> writes:
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
Mar 02 2004
parent reply Arjan Knepper <arjan ask.me> writes:
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.
Mar 03 2004
parent reply Arjan Knepper <arjan ask.me> writes:
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
Mar 03 2004
next sibling parent Eliot <eblennerhassett audioscience.com> writes:
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
Mar 03 2004
prev sibling parent reply Eliot <eblennerhassett audioscience.com> writes:
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
Mar 03 2004
parent reply Scott Michel <scottm cs.ucla.edu> writes:
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
Mar 04 2004
parent reply Arjan Knepper <arjan ask.me> writes:
Scott Michel wrote:
 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
Open the *.prj file in a text editor, remove all lines with starting with -1, order de *.lib files. Save file and reopen with the IDDE. Arjan
Mar 04 2004
parent reply Eliot <eblennerhassett audioscience.com> writes:
[I'm crossposting this summary to wxwindows for future reference by other 
victims, Original thread title was "Linker commands generated by IDDE" (Thanks 
Arjan) ]

I found that the order of libraries in the link command affects whether the 
program runs or not!

Here is a working library order for controls sample:
..\..\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

Not sure what the actual ordering contstraints are.  Possibly
wx_sc first
wsock32 before winmm32

To reorder the libraries in the IDDE:

Open the *.prj file in a text editor, remove all lines with starting with -1, 
order de *.lib files. Save file and reopen with the IDDE.


- Eliot
Mar 04 2004
next sibling parent reply Cesar Rabak <crabak acm.org> writes:
Eliot escreveu:
 [I'm crossposting this summary to wxwindows for future reference by 
 other victims, Original thread title was "Linker commands generated by 
 IDDE" (Thanks Arjan) ]
 
 I found that the order of libraries in the link command affects whether 
 the program runs or not!
Maybe the (some, at least two of them) libraries contain objects with the same name but w/slightly different behaviours?
Mar 04 2004
parent "Walter" <walter digitalmars.com> writes:
"Cesar Rabak" <crabak acm.org> wrote in message
news:4047DF63.7090902 acm.org...
 Eliot escreveu:
 [I'm crossposting this summary to wxwindows for future reference by
 other victims, Original thread title was "Linker commands generated by
 IDDE" (Thanks Arjan) ]

 I found that the order of libraries in the link command affects whether
 the program runs or not!
Maybe the (some, at least two of them) libraries contain objects with the same name but w/slightly different behaviours?
That's really the only thing that library order should affect.
Mar 05 2004
prev sibling parent reply Jorge <Jorge_member pathlink.com> writes:
[I'm crossposting this summary to wxwindows for future reference by other 
victims, Original thread title was "Linker commands generated by IDDE" (Thanks 
Arjan) ]
I'm a victim too :)
Not sure what the actual ordering contstraints are.  Possibly
wx_sc first
wsock32 before winmm32
To reorder the libraries in the IDDE:
I got the same problem, DMC 8.40 & WXWidgets 2.4.2. The information posted here is very useful. Try this: Delete all c:\wxwidgets\lib\*_SC.lib Remove the line ''_WSACleanup 0 = WSACleanup'' in file c:\wxwidgets\lib\_sc\winmm32_sc.def Rebuild wxwidgets. I don't know if it's a good idea, but "it works for me" ;) Suggestions? Jorge
Mar 31 2004
parent chris elliott <biol75 york.ac.uk> writes:
I am sorry, but I missed this discussion earlier, and am rather 
confused. I'd like to fix this if I can:

1) When does a bug strike, and what are the symptoms?

2) is it in IDDE builds only, or with makefiles as well

3) is the solution to remove *or* reposition _WSACleanup 0 = WSACleanup 
in the def file?

4) if removal is needed, do the  samples still compile.

Thanks for more details, so i can look for the right bug
chris


Jorge wrote:
[I'm crossposting this summary to wxwindows for future reference by other 
victims, Original thread title was "Linker commands generated by IDDE" (Thanks 
Arjan) ]
I'm a victim too :)
Not sure what the actual ordering contstraints are.  Possibly
wx_sc first
wsock32 before winmm32
To reorder the libraries in the IDDE:
I got the same problem, DMC 8.40 & WXWidgets 2.4.2. The information posted here is very useful. Try this: Delete all c:\wxwidgets\lib\*_SC.lib Remove the line ''_WSACleanup 0 = WSACleanup'' in file c:\wxwidgets\lib\_sc\winmm32_sc.def Rebuild wxwidgets. I don't know if it's a good idea, but "it works for me" ;) Suggestions? Jorge
Apr 01 2004