Fix the example for MSVC in the Embedding Julia documentation#44587
Fix the example for MSVC in the Embedding Julia documentation#44587Taaitaaiger wants to merge 1 commit intoJuliaLang:masterfrom
Conversation
|
This feels a bit fussy. Does this mean we need to something within Julia to make it nicer? |
|
Do you mean nicer in the sense that the additional includes and using C++ wouldn't be necessary? That would definitely be better IMO, but I'm not sure if that's possible because Julia uses features like |
|
Ok. I suppose having a working example is better in any case. @vtjnash can you review? |
vtjnash
left a comment
There was a problem hiding this comment.
This change seems to make no sense to me. I think it is all old support content for headers that we deleted in v1.8?
|
The issue is quite old, actually. The example that's currently available already failed to build with MSVC using Julia 1.5: #37957 I decided to provide a new example based on what CxxWrap does because that example works. |
|
Right, but you are targeting v1.9 with this PR, not old versions like v1.5.x |
|
This PR doesn't affect any code but only changes some documentation. I think you might be confused with this recent PR I've made recently: #44842 |
|
No, I mean this documentation change seems to specify incorrect changes, needed only to work around bugs in old versions of Julia |
|
Closing as I believe this does not apply to master, only old versions. Please let me know if that is wrong and we will try to fix master not to need this. |
|
I was just checking this, it's true that the original "No Target Architecture" error appears only in Julia 1.6 and 1.7, but using the latest nightly there still is an error that is fixed by adding these lines. The error I get when removing the workaround from CxxWrap is: With the workaround, it compiles against nightly. Presumably 1.8 has the same issue, but there MSVC doesn't work because of #44842. |
|
ah, I suppose we could add this code (from uv/win.h) to src/support/dtypes.h to make sure that definition is available in standalone mode 26 #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
1 typedef intptr_t ssize_t;
2 # define SSIZE_MAX INTPTR_MAX
3 # define _SSIZE_T_
4 # define _SSIZE_T_DEFINED
5 #endif |
|
Thanks for checking, @barche, and providing a better PR! |
The current example for embedding Julia with MSVC fails to compile, this pull request provides a working example using code from
julia_headers.hppfromCxxWrap