Wireshark-users: Re: [Wireshark-users] Link warning while compiling the code.
From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Fri, 09 May 2008 16:10:46 +0100
Roshan Nair wrote:
Hi,

I am facing issues while compiling my code for wireshark version 0.99.6. If I make some changes to epan/dissectors/packet-rtp.c and than compile again, the file does not get compiled at all and my changes do not get reflected when I run the exe. I am compiling the code on windows machine as per the procedure mentioned in the Developers guide.

There are no errors when I compile, but when I see the logs I see a link error as below :

......
.....
......
    cd ..\gtk2.tmp
    "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /                   /f Makefile.nmake GTK_CFLAGS="/IC:\wireshark-win32-libs\glib\include\glib-20  /IC:\wireshark-win32-libs\glib\lib\glib-2.0\include /IC:\wireshark-win32-libs\gtk2\include\gtk-2.0  /IC:\wireshark-win32-libs\gtk2\lib\gtk-2.0\include  /IC:\wireshark-win32-libs\gtk2\include\atk-1.0  /IC:\wireshark-win32-libs\gtk2\include\cairo  /IC:\wireshark-win32-libs\gtk2\include\pango-1.0" GTK_LIBS="C:\wireshark-win32-libs\gtk2\lib\gtk-win32-2.0.lib  C:\wireshark-win32-libs\gtk2\lib\gdk-win32-2.0.lib  C:\wireshark-win32-libs\gtk2\lib\gdk_pixbuf-2.0.lib  C:\wireshark-win32-libs\gtk2\lib\pango-1.0.lib  C:\wireshark-win32-libs\glib\lib\glib-2.0.lib  C:\wireshark-win32-libs\glib\lib\gmodule-2.0.lib  C:\wireshark-win32-libs\glib\lib\gobject-2.0.lib" libui.lib
'libui.lib' is up-to-date
    cd ..
Linking wireshark-gtk2.exe
    link @C:\DOCUME~1\NAIRR~1.BLR\LOCALS~1\Temp\nm309.tmp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
    mt.exe -nologo -manifest "wireshark-gtk2.exe.manifest" -outputresource:wireshark-gtk2.exe;1


.....
.....
.....

Is there a way I can get around this link error ?

It's a warning and has been there a long time.  I don't think it's connected with your problem.  You might want to think about moving to a new version of the source as well.  Support for the VC8 compiler you're using has improved there.

If you modify the dissector source and issue a subsequent nmake -f makefile.nmake you should see the source file being compiled.  If not you have a broken build environment.

How are you deciding that the source file hasn't been compiled?  Are you running wireshark from the wireshark-gtk2 subdirectory or the one in the installed directory?  The build process doesn't install a new copy into "Program Files", but it does make a runnable copy in the wireshark-gtk2 dir which you can "cd" to and run.

-- 
Regards,

Graham Bloice