Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import on Windows #6

Closed
cHemingway opened this issue Jul 27, 2020 · 3 comments · Fixed by #9
Closed

Cannot import on Windows #6

cHemingway opened this issue Jul 27, 2020 · 3 comments · Fixed by #9

Comments

@cHemingway
Copy link

Attempting to import the library, with Python 3.8.1, Windows 10, gets the following error.

>>> import cxxfilt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\christopher.h\AppData\Local\Programs\Python\Python38-32\lib\site-packages\cxxfilt\__init__.py", line 39, in <module>
    libc = ctypes.CDLL(find_any_library('c'))
  File "C:\Users\christopher.h\AppData\Local\Programs\Python\Python38-32\lib\site-packages\cxxfilt\__init__.py", line 36, in find_any_library
    raise Error('Cannot find any of libraries: {}'.format(choices))
cxxfilt.Error: Cannot find any of libraries: ('c',)

Checking the ctypes documentation, line 33 is not valid on Windows, as:

On Windows, find_library() searches along the system search path, and returns the full pathname, but since there is no predefined naming scheme a call like find_library("c") will fail and return None.

Instead, it appears find_mscvrt() should be used on windows, especially as libc is only being used for free()

@cHemingway
Copy link
Author

Looking more closely at this, it seems UnDecorateSymbolName should be used instead of __cxa_demangle() on Windows.

@afq984
Copy link
Owner

afq984 commented Jul 29, 2020

Yes, windows is not supported now. I'm not familiar with using Python in Windows so there are a few questions to answer:

  1. Does UnDecorateSymbolName use the same mangling rules as libstdc++/libc++? If not, what would a user expect this library to do? (update: Should it demangle using libstdc++'s rules or using MSVC's rules?)
  2. Need to set up a CI for windows.

@afq984
Copy link
Owner

afq984 commented Aug 16, 2021

The import time error will be solved by #9.
The error will be delayed to demangle demangleb calls.
Open another issue if actual windows support is needed.

@afq984 afq984 linked a pull request Aug 16, 2021 that will close this issue
@afq984 afq984 closed this as completed in #9 Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants