Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I must have slipped a disk -- my pack hurts!


devel / comp.lang.python / Unable to compile my C Extension on Windows: unresolved external link errors

SubjectAuthor
o Unable to compile my C Extension on Windows: unresolved external linkMarco Sulla

1
Unable to compile my C Extension on Windows: unresolved external link errors

<mailman.198.1636727440.23718.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15956&group=comp.lang.python#15956

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Marco.Su...@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Unable to compile my C Extension on Windows: unresolved external link
errors
Date: Fri, 12 Nov 2021 15:30:01 +0100
Lines: 31
Message-ID: <mailman.198.1636727440.23718.python-list@python.org>
References: <CABbU2U-d0f=mD5DXxgnDr=qc=p-XsFfi83YCd=vcFEXURHJymw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de vD1//DZzcWoBxqSxQ+Hqpwe5g2KauUku8Otd/+yLaNpw==
Return-Path: <elbarbun@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=p61LSXfa;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Unable': 0.03;
'url-ip:140.82/16': 0.03; 'pip': 0.04; 'windows,': 0.05;
'subject:Windows': 0.07; 'compiler': 0.09; 'linux': 0.09;
'received:209.85.219': 0.09; 'skip:[ 20': 0.09; 'url:master':
0.09; 'steps': 0.11; 'url:github': 0.14; 'url-ip:140/8': 0.15;
'from:name:marco sulla': 0.16; 'machine,': 0.16; 'setuptools':
0.16; 'symbol': 0.16; 'problem': 0.16; 'python': 0.16; 'to:addr
:python-list': 0.20; 'install': 0.23; 'installed': 0.23; 'run':
0.23; 'extension': 0.25; 'it,': 0.29; 'error': 0.29; 'message-
id:@mail.gmail.com': 0.32; 'windows': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'received:209.85': 0.37;
'received:209': 0.39; 'on.': 0.39; 'here': 0.62; 'full': 0.64;
'sources': 0.75; 'subject:link': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:from:date:message-id:subject:to;
bh=Ty/fFA0EadwAKXcDzGFmeAmAf0c5SUxx6I1gvBFFF2s=;
b=p61LSXfa++l9cibpTliXx24Hh6LICYjYZcfOSXH/WKAPW3KOzzOtYQy5/FQhcuCd0Z
dYewOFy0SLU1U2aKvS9k1nYCi37LPiTtvNJlvcDMd899hWC80pnWxjCCGnWhMahaizGE
6o/M7I7d8BAE6w555EBXVeWmTWF5Hhu112gghSgVDucAT5TDvY33SAP7cJuBDAzDCuAA
rsflhJyB6Z0QBbmz6iX5+SMPgYArHxrNwCz3FA1RVColu3dx2FclsCDP5twsKUOY7w0Z
65l74LFP/edMURLpcK4atyzhPTE52vqnGDKKaK7czRws4jSsoZJmoor0NJXWE3BJ3Rrx
SvQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=Ty/fFA0EadwAKXcDzGFmeAmAf0c5SUxx6I1gvBFFF2s=;
b=bzBRjL1MkcL+a2d+ILCUY/Wy3eZ6uwxu67Kv7razN5FjeHNqaVODnOOyt/MBEfJ93S
j8VUF6biSuODalNHlHAGKdPuyUZw9nUtQbEk4I4hJU7+BkxnnmxxsBGA4zo5B/pNW0m7
v93lwWgsGu/KXCJnMiMkPjQdyxLeJCzq1X/uPZHPV6t6lHrVcNIdLqKDJSll9X6FtR7e
R4hFIXFdF149pkXwtXjE2BZ6RnYOQ4ayTfi5hk/GQdnGwdJydXZ6mC/NF7DQ9BzPsYBj
8Yk3EmZr8cVhAT+KS1WlktH8r93St5uvCzkqUKEB/u/n7rbSe/8YyhXzP1i8O94QG/V8
BndA==
X-Gm-Message-State: AOAM532yyNpmWPaUulrNj0h05Mk6FgVc4JaIdk+GsdCbo059HDivU+MQ
GeJK+Q9eiPWS+cKbb4kIat4iPtGWU4WjewloWpKsaQSG
X-Google-Smtp-Source: ABdhPJyvMF9Q6U3H0yoxKHoYkKNOS1JbATIak+9XN2wRLKUxzOBtLq/pl29r6I7sFNB+ub+LJNMLMMLep6cKusVQ9II=
X-Received: by 2002:a5b:d41:: with SMTP id f1mr16750014ybr.447.1636727437519;
Fri, 12 Nov 2021 06:30:37 -0800 (PST)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CABbU2U-d0f=mD5DXxgnDr=qc=p-XsFfi83YCd=vcFEXURHJymw@mail.gmail.com>
 by: Marco Sulla - Fri, 12 Nov 2021 14:30 UTC

I have no problem compiling my extension under Linux and MacOS. Under
Windows, I get a lot of

Error LNK2001: unresolved external symbol PyErr_SetObject

and so on.

I post the part of my setup.py about the C Extension:

extra_compile_args = ["-DPY_SSIZE_T_CLEAN", "-DPy_BUILD_CORE"]
undef_macros = []

setuptools.Extension(
ext1_fullname,
sources = cpython_sources,
include_dirs = cpython_include_dirs,
extra_compile_args = extra_compile_args,
undef_macros = undef_macros,
)

Here is the full code:
https://github.com/Marco-Sulla/python-frozendict/blob/master/setup.py

Steps to reproduce: I installed python3.10 and VS compiler on my
Windows 10 machine, then I created a venv, activated it, run

pip install -U pip setuptools wheel

and then

python setup.py bdist_wheel

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor