Wireshark-dev: Re: [Wireshark-dev] Error compiling acustomdllpluginforWireshark0.99.7

From: "Peter Johansson" <peterjohansson73@xxxxxxxxx>
Date: Fri, 7 Mar 2008 13:35:11 +0100
I assume you have verified that the parts that are multiply defined according to the linker are not multiply defined in the source code.
Are you including a .c file somewhere (instead of a .h file)? That could lead to multiply defined instances of data and/or functions.
 
/ Peter
 
2008/3/6, A Verma <laughaloud43@xxxxxxxxx>:
Hi,
In config.nmake, I changed from "LOCAL_LDFLAGS=/DEBUG" to "LOCAL_LDFLAGS=/NODEFAULTLIB:LIBC " changed the but I still get the following errors:

       cd xxx
        "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /
          -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

Making plugin.c (using python)
        sed -e s/@PLUGIN_NAME@/xxx/  -e s/@RC_MODULE_VERSION@/0,6,5,0/  -e s/@RC
_VERSION@/0,99,9,0/  -e s/@MODULE_VERSION@/0.6.5.0/  -e s/@PACKAGE@/xxx/  -e s/@
VERSION@/0.99.9"-XXX-GTP-01"/  -e s/@MSVC_VARIANT@/MSVC2005EE/  < plugin.rc.in >
 xxx.rc
        rc  /r xxx.rc
        cl /DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ /WX /DHAVE_CONFIG_H
 /I../.. /I../../wiretap /IC:\wireshark-win32-libs\glib\include\glib-2.0  /IC:\w
ireshark-win32-libs\glib\lib\glib-2.0\include  /IC:\wireshark-win32-libs\pcre-7.
0\include /IC:\wireshark-win32-libs\WPdpack\include -D_U_="" /Zi /W3 /MD /D_CRT_
SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMSC_VER_REQUIRED=1400 -Fd.\ -c
 packet-xxx.c plugin.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86

Copyright (C) Microsoft Corporation.  All rights reserved.

packet-xxx.c
plugin.c
Generating Code...
        link -dll /out:xxx.dll /NOLOGO /INCREMENTAL:no /MACHINE:I386 /NODEFAULTL
IB:LIBC packet-xxx.obj  plugin.obj ..\..\epan\libwireshark.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 xxx.res
plugin.obj : error LNK2005: _version already defined in packet-xxx.obj
plugin.obj : error LNK2005: _plugin_register already defined in packet-xxx.obj
plugin.obj : error LNK2005: _plugin_reg_handoff already defined in packet-xxx.obj
   Creating library xxx.lib and object xxx.exp
xxx.dll : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x491'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

Any clues?

Thanks & regards,

Ash


 
On 3/6/08, A Verma <laughaloud43@xxxxxxxxx> wrote:
Hi,
Thanks ya I did correct the warnings. I wanted ask if there is way to supress them.
 
Well now I am getting new link errors :-(  :

       

cd ..

cd xxx

"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" /

-f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762

Copyright (C) Microsoft Corporation. All rights reserved.

Making plugin.c (using python)

sed -e s/@PLUGIN_NAME@/xxx/ -e s/@RC_MODULE_VERSION@/0,6,5,0/ -e s/@RC

_VERSION@/0,99,9,0/ -e s/@MODULE_VERSION@/0.6.5.0/ -e s/@PACKAGE@/xxx/ -e s/@

VERSION@/0.99.9"-XXX-GTP-01"/ -e s/@MSVC_VARIANT@/MSVC2005EE/ < plugin.rc.in >

xxx.rc

rc /r xxx.rc

cl /DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ /WX /DHAVE_CONFIG_H

/I../.. /I../../wiretap /IC:\wireshark-win32-libs\glib\include\glib-2.0 /IC:\w

ireshark-win32-libs\glib\lib\glib-2.0\include /IC:\wireshark-win32-libs\pcre-7.

0\include /IC:\wireshark-win32-libs\WPdpack\include -D_U_="" /Zi /W3 /MD /D_CRT_

SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMSC_VER_REQUIRED=1400 -Fd.\ -c

packet-xxx.c plugin.c

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86

Copyright (C) Microsoft Corporation. All rights reserved.

packet-xxx.c

plugin.c

Generating Code...

link -dll /out:xxx.dll /NOLOGO /INCREMENTAL:no /MACHINE:I386 /DEBUG pack

et-xxx.obj plugin.obj ..\..\epan\libwireshark.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 xxx.res

plugin.obj : error LNK2005: _version already defined in packet-xxx.obj

plugin.obj : error LNK2005: _plugin_register already defined in packet-xxx.obj

plugin.obj : error LNK2005: _plugin_reg_handoff already defined in packet-xxx.obj

Creating library xxx.lib and object xxx.exp

xxx.dll : fatal error LNK1169: one or more multiply defined symbols found

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\l

ink.EXE"' : return code '0x491'

Stop.

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n

make.exe"' : return code '0x2'

Stop.

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n

make.exe"' : return code '0x2'

Stop.

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n

make.exe"' : return code '0x2'

Stop.

How can I resolve these errors?

Thanks,

Ash

On 3/6/08, Stig Bjørlykke <stig@xxxxxxxxxxxxx> wrote:
Hi,

If you read the warnings you will see what is wrong:

  packet-xxx.c(1077) : warning C4244: '=' : conversion from 'time_t'
to 'unsigned int', possible loss of data

This warning tells you that you are trying to convert a time_t to an
unsigned int, which may lead to loss of data.  In Wireshark
nstime_t.secs is defined as time_t, not unsigned int.

You can fix this in one of two ways:

1. Use correct data types for hours, mins and secs:
time_t hours;
time_t mins;
time_t secs;

2. Add a cast in the assignment:
hours = (unsigned int)(tagv.secs / 3600);
mins = (unsigned int)((tagv.secs - (hours * 3600)) / 60);
secs = (unsigned int)(tagv.secs - (hours * 3600) - (mins * 60));


--
Stig Bjørlykke
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev



_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev