-
Notifications
You must be signed in to change notification settings - Fork 39
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
Compiling on Windows? #42
Comments
I can reproduce this issue exactly; I think it is potentially due to something being marked as Unfortunately, just nuking |
Indeed, there's actually errors about this:
|
Right, I've got it to work, but it is a "hack". Here's a diff: diff --git a/C/API.h b/C/API.h
index fa65fd8..18ca42e 100644
--- a/C/API.h
+++ b/C/API.h
@@ -21,6 +21,10 @@
#ifndef PYSCHE_C_API_H__
#define PYSCHE_C_API_H__
+#ifdef PSY_C_API
+#undef PSY_C_API
+#endif
+
// From https://gcc.gnu.org/wiki/Visibility
#if defined _WIN32 || defined __CYGWIN__
#ifdef EXPORT_API
@@ -55,4 +59,7 @@
#endif
#endif
+#undef PSY_C_API
+#define PSY_C_API
+
#endif
diff --git a/C/plugin-api/PluginConfig.h b/C/plugin-api/PluginConfig.h
index 4897cd5..47b6538 100644
--- a/C/plugin-api/PluginConfig.h
+++ b/C/plugin-api/PluginConfig.h
@@ -21,6 +21,10 @@
#ifndef PLUGIN_C_CONFIG_H__
#define PLUGIN_C_CONFIG_H__
+#ifdef PLUGIN_API
+#undef PLUGIN_API
+#endif
+
// From https://gcc.gnu.org/wiki/Visibility
#if defined _WIN32 || defined __CYGWIN__
#ifdef EXPORT_API
@@ -47,4 +51,7 @@
#endif
#endif
+#undef PLUGIN_API
+#define PLUGIN_API
+
#endif
diff --git a/common/API.h b/common/API.h
index 468f883..221fa5b 100644
--- a/common/API.h
+++ b/common/API.h
@@ -21,6 +21,10 @@
#ifndef PSYCHE_API_H__
#define PSYCHE_API_H__
+#ifdef PSY_API
+#undef PSY_API
+#endif
+
// From https://gcc.gnu.org/wiki/Visibility
#if defined _WIN32 || defined __CYGWIN__
#ifdef EXPORT_API
@@ -47,4 +51,7 @@
#endif
#endif
+#undef PSY_API
+#define PSY_API
+
#endif (save it to a file, and then do Now do your build and it should succeed, but it won't work:
to fix that:
such that you get:
now you'll have:
Unfortunately, I have no motivation to "wrap this up" into something that could become a PR. However, if you're happy with the manual steps, the above should be enough to "keep you moving". |
…o#42 Signed-off-by: Andrew V. Jones <[email protected]>
@geekrelief please check my reply to @andrewvaughanj 's PR here. Thanks for trying to help @andrewvaughanj :-) |
@andrewvaughanj Thanks for the patch above. Following your directions I was able to get And I've been looking at various home grown solutions from Nim using tree-sitter, clang's AST, and custom parser solutions. Thanks for getting back to me so quickly! Btw, is there way to get Pyschec compiling from Visual Studio? Before going the MSYS route, I had cmake installed via scoop, and I was able to produce solution files. Unfortunately, trying to Build the Unfortunately, VS still hangs. I see these errors in the output: |
That's cool @geekrelief ! In regards to Windows/Visual Studio, I can't help much right now (maybe in the future). But it won't be only about compiling, there are portions of the code that might not behave properly in Windows — from the top of my mind, I can think of Process and CompilerFacade. @andrewvaughanj I merged your patch, thanks again! |
Compiling with MSVC probably isn't as easy as with MSYS -- especially with things such as the flags that the CMakeLists.txt set. However the error you've linked in your screenshot (about the operators!) is going to be because it was "partially broken" in the diff I gave. You should try this again now, because I did set the linkage for the |
I retried the latest commit in master just now, and I still get the same errors about Thanks for the help! |
Hmm, yeah, I hadn't noticed that it seems this header is used in both "common" and "cfe" -- If those messages are correct, then it seems it has inconsistent linkage inside of those modules (it should be |
Do you have any advice for getting this to compile on Windows? I'm using MSYS with the Windows version of cmake so I can call the generator for "MSYS Makefiles", but calling
make
I've run into these errors.The text was updated successfully, but these errors were encountered: