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

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

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

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.

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

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

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

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

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

[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

[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?

[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?

[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

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