git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] msvc: git-daemon: Fix linker "unresolved external" errors

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jan 31, 2013, 18:30 UTC
Message-ID
<510AB836.5090209@ramsay1.demon.co.uk>

In particular, while linking git-daemon.exe, the linker complains that the external symbols _inet_pton and _inet_ntop are unresolved. Commit a666b472 ("daemon: opt-out on features that require posix", 04-11-2010) addressed this problem for MinGW by configuring the use of the internal 'compat' versions of these function.

Although the MSVC header <WS2tcpip.h> contains the prototypes for the inet_pton and inet_ntop functions, they are only visible for Windows API versions from 0x0600 (Windows Vista) or later. (In addition, on Windows XP, ws2_32.dll does not export these symbols).

In order to fix the linker errors, we also configure the MSVC build to use the internal compat versions of these functions by setting the NO_INET_{PTON,NTOP} build variables.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 config.mak.uname | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index bea34f0..7e52f3c 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -344,6 +344,8 @@ ifeq ($(uname_S),Windows)
 	NO_CURL = YesPlease
 	NO_PYTHON = YesPlease
 	BLK_SHA1 = YesPlease
+	NO_INET_PTON = YesPlease
+	NO_INET_NTOP = YesPlease
 	NO_POSIX_GOODIES = UnfortunatelyYes
 	NATIVE_CRLF = YesPlease
 	DEFAULT_HELP_FORMAT = html
-- 
1.8.1
Message 1 of 1 in “msvc: git-daemon: Fix linker "unresolved external" errors”
  1. 2/5 msvc: git-daemon: Fix linker "unresolved external" errorsRamsay Jones, Jan 31, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.