Bug 1737 – A strange "Previous Definition Different"

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-12-17T03:25:00Z
Last change time
2015-06-09T05:15:00Z
Assigned to
bugzilla
Creator
zsp007

Comments

Comment #0 by zsp007 — 2007-12-17T03:25:57Z
I create a new project with IDE poseidon and the lastest DMD2. Complie below code with option "-g" A strange "Previous Definition Different" happend. Code: import std.c.windows.windows, std.c.windows.winsock; static this(){ WSADATA wd; } int main (){ htons(9001); return 0; } Complie Information Command >>> ReBuilding Project: stalk...... D:\myWay\env\d\env\dmd\bin\dmd.exe D:\myWay\D\stalk\stalk.d -ofstalk - ID:\myWay\env\d\env\dmd\import D:\myWay\env\d\env\dmd\lib\WS2_32.LIB - odobjs -g D:\myWay\env\d\env\dmd\bin\..\..\dm\bin\link.exe objs\stalk,stalk,,D: \myWay\env\d\env\dmd\lib\WS2_32.LIB+user32+kernel32/co/noi; OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. D:\myWay\env\d\env\dmd\bin\..\lib\phobos.lib(winsock) Offset 2597FH Record Type 00C3 Error 1: Previous Definition Different : _htons@4
Comment #1 by davidl — 2007-12-17T20:32:15Z
Phobos already has this htons symbol. So don't link with WS2_32.LIB again. Then the problem goes away.