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

Dynlink linker error on Windows MinGW #389

Open
Mostafa-wael opened this issue Feb 23, 2023 · 2 comments
Open

Dynlink linker error on Windows MinGW #389

Mostafa-wael opened this issue Feb 23, 2023 · 2 comments

Comments

@Mostafa-wael
Copy link

This issue was originally reported here.

Trying to install the Metacall CLI on a Windows machine using the installation guide.

The last step: cmake --build . --target install results in the following error:

C:\Users\USER>cd core

C:\Users\USER\core>cd build

C:\Users\USER\core\build>cmake --build . --target install
[  1%] Built target version
[  1%] Built target preprocessor
[  2%] Built target environment
[  3%] Built target format
[  4%] Built target backtrace
[  5%] Built target threading
[ 13%] Built target log
[ 15%] Built target memory
[ 16%] Built target portability
[ 18%] Built target adt
[ 19%] Built target filesystem
[ 20%] Linking CXX shared library ..\..\libdynlinkd.dll
CMakeFiles\dynlink.dir/objects.a(dynlink_impl_win32.c.obj): In function `dynlink_impl_interface_lib_path_win32':
C:/Users/USER/core/source/dynlink/source/dynlink_impl_win32.c:124: undefined reference to `EnumProcessModules@16'
C:/Users/USER/core/source/dynlink/source/dynlink_impl_win32.c:132: undefined reference to `GetModuleFileNameExA@16'
collect2.exe: error: ld returned 1 exit status
source\dynlink\CMakeFiles\dynlink.dir\build.make:171: recipe for target 'libdynlinkd.dll' failed
mingw32-make.exe[2]: *** [libdynlinkd.dll] Error 1
CMakeFiles\Makefile2:3839: recipe for target 'source/dynlink/CMakeFiles/dynlink.dir/all' failed
mingw32-make.exe[1]: *** [source/dynlink/CMakeFiles/dynlink.dir/all] Error 2
Makefile:154: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

C:\Users\USER\core\build>
@Mostafa-wael
Copy link
Author

Mostafa-wael commented Feb 23, 2023

There is no need to build and install the CLI manually anymore.
For Windows, consider using the PowerShell installation script.

powershell -NoProfile -ExecutionPolicy unrestricted -Command “[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing ‘https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"

Refer to this repo for more details.

@viferga
Copy link
Member

viferga commented Mar 24, 2023

I want to keep this issue open because it would be interesting to compile the core with MinGW. The issue is related to MinGW compiler and it should be handled eventually. Some loaders are not supported to be compiled with MinGW (NodeJS can't be compiled with MinGW) so this means support for this compiler will be always partial. But in any case, testing more compilers will increase the stability of the project.

@viferga viferga changed the title MetaCall CLI Installation error on Windows Dynlink linker error on Windows MinGW Apr 25, 2023
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

No branches or pull requests

2 participants