Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 06-10-2018, 07:26 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default Is it possible to compile SWS with anything other than MSVC?

I would like to add a few simple functions to SWS to expose some window-related functions (WindowFromPoint, ClientToScreen and GetClientRect) to the Lua API.

Unfortunately, installing VC is turning out to be more difficult than the actual coding: None of my online devices use Windows, and there doesn't seem to be any easy way to get an offline installer for VC.

In the extensions SDK page, Justin wrote that "Extensions for REAPER/win32 should be written in C++ and compiled using MSVC (pure virtual interface classes are used and as such the C++ ABI must be compatible -- sorry, mingw users)." However, that was written in 2009, so hopefully other compilers have become compatible since then.

I have tried building SWS with MinGW, but I get lots of errors. It seems that the SWS code uses lots of compiler-specific stuff such as "i64" suffixes.

Last edited by juliansader; 06-10-2018 at 09:40 AM.
juliansader is offline   Reply With Quote
Old 06-10-2018, 07:39 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Nope, you have to use the Microsoft compiler on Windows.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-10-2018, 10:58 AM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

You could compile / build on OSX or Linux instead though.

https://github.com/reaper-oss/sws/wi...-SWS-Extension
nofish is offline   Reply With Quote
Old 06-10-2018, 11:06 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by nofish View Post
You could compile / build on OSX or Linux instead though.

https://github.com/reaper-oss/sws/wi...-SWS-Extension
Right, but to get binaries that work on Windows, they have to be built on Windows using the Microsoft compiler.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-10-2018, 11:19 AM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by Xenakios View Post
Right, but to get binaries that work on Windows, they have to be built on Windows using the Microsoft compiler.
Ok, wasn't clear to me from the question if meant Windows related or building SWS in general.
nofish is offline   Reply With Quote
Old 06-19-2018, 01:29 PM   #6
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I finally figured out how to install Visual Studio offline: The older versions -- from before online installer became trendy -- were still available as .iso downloads.
juliansader is offline   Reply With Quote
Old 06-20-2018, 10:36 AM   #7
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 797
Default

Quote:
Originally Posted by juliansader View Post
In the extensions SDK page, Justin wrote that "Extensions for REAPER/win32 should be written in C++ and compiled using MSVC (pure virtual interface classes are used and as such the C++ ABI must be compatible -- sorry, mingw users)." However, that was written in 2009, so hopefully other compilers have become compatible since then.
I just want to say that it is theoretically possible to compile REAPER extensions with mingw (I do this), but that to too tricky for "mainstream" developers
azslow3 is offline   Reply With Quote
Old 06-20-2018, 10:54 AM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by azslow3 View Post
I just want to say that it is theoretically possible to compile REAPER extensions with mingw (I do this), but that to too tricky for "mainstream" developers
Why do some horrible tricks that might fail, when the simple solution is to just download the free of charge Visual Studio from Microsoft?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 06-20-2018, 11:31 AM   #9
junko
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Quote:
Originally Posted by Xenakios View Post
Why do some horrible tricks that might fail, when the simple solution is to just download the free of charge Visual Studio from Microsoft?
a better question !
Why to be strict to a not so popular compiler ?
junko is offline   Reply With Quote
Old 06-21-2018, 02:52 AM   #10
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 797
Default

Quote:
Originally Posted by junko View Post
a better question !
Why to be strict to a not so popular compiler ?
+. If one program should work on 3 platforms, why not use a compiler which works on all these platforms?

Also "tricks" are not really horrible. Just several defines before including REAPER API headers and several "mods" to replace (not so many) "classes" with proper defined "structures".
I write plug-ins in "plain C" (to avoid g++ library, compiles faster and I know what exactly is going to be generated), that requires a bit more "tricks".
The only requirement - understanding what C++ ABI is exactly and the differences in it between VC and (cross)GCC. Most programmers I know, which write C(++) code for decades, have rather fussy knowledge in that topic (for most people digging so deep without practical application is a waste of time).

Note that I am writing about REAPER API itself, not about re-compiling C++ extensions.
azslow3 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.