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

#pragma load(<libraryname>.dll) in Windows Subsystem for Linux #498

Open
WesFrank opened this issue Oct 11, 2023 · 0 comments
Open

#pragma load(<libraryname>.dll) in Windows Subsystem for Linux #498

WesFrank opened this issue Oct 11, 2023 · 0 comments

Comments

@WesFrank
Copy link

WesFrank commented Oct 11, 2023

I am using xeus-cling on Windows Subsystem for Linux, which is currently the most popular/best known alternative to the no-windows-support-related "problem".

I often use the magic %%file to write .cpp scripts to a Windows directory as follows ...

%%file /mnt/c/Users//path/to/project/.cpp
/*
cpp code here
*/

I sometimes compile files using the following syntax in a code cell ...

! powershell.exe g++ C:\Users\\path\to\project\.cpp -o C:\Users\\path\to\project\.exe

It is also possible for me to create .dll and .dir files using a similar command as the above with the -shared flag.

The problem that I experience is to import .dll and .dir using the #pragma directive like so ...

#pragma cling add_include_path("/mnt/c/Users//path/to/project/") // no error
#pragma cling add_library_path("/mnt/c/Users//path/to/project/") // no error

I have also tried it like this ...

#pragma cling add_include_path("C:\Users\\path\to\project\") // no error
#pragma cling add_library_path("C:\Users\\path\to\project\") // no error

which does not really seem what's causing the problem.

However, running the below in a code cell ...

#pragma cling load(".dll")

gives this error ...

input_line_147:1:29: error: expected .dll to be a library, but it is not. If this is a source file, use #include "<libraryname>.dll"
#pragma cling load(".dll")
^ (This little up-arrow should be pointing to the closing parenthesis)
Interpreter Error:

Is there a fix for this or does anyone have an idea of how to work around this, or will this just be classified as a no-windows-support-related error?

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

1 participant