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

Reply
 
Thread Tools Display Modes
Old 11-21-2011, 04:06 PM   #1
AudiOishi
Human being with feelings
 
Join Date: Dec 2009
Posts: 50
Default build sws extensions - redefinition errors, Other question.

I'm looking for an introduction to using the Reaper SDK, and as recommended, I'm looking at the SWS extensions as an example.

It looks like the sws extensions want the WDL source folder to live one level up from the sws-extensions folder, so I downloaded it and placed it appropriately.

When I try to build the sws extensions in VS 2008 Express I get the following errors:


Code:
1>------ Build started: Project: SWS_Extension, Configuration: Test Win32 ------
1>Checking for REAPER_DIR environment variable...
1>Compiling...
1>stdafx.cpp
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(920) : error C2365: 'LICE_Arc' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(469) : see declaration of 'LICE_Arc'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(922) : error C2365: 'LICE_Blit' : redefinition; previous definition was 'function'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(924) : error C2365: 'LICE_Blur' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(367) : see declaration of 'LICE_Blur'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(926) : error C2365: 'LICE_BorderedRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(498) : see declaration of 'LICE_BorderedRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(928) : error C2365: 'LICE_Circle' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(471) : see declaration of 'LICE_Circle'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(930) : error C2365: 'LICE_Clear' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(411) : see declaration of 'LICE_Clear'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(932) : error C2365: 'LICE_ClearRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(412) : see declaration of 'LICE_ClearRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(935) : error C2365: 'LICE_ClipLine' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(466) : see declaration of 'LICE_ClipLine'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(937) : error C2365: 'LICE_Copy' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(360) : see declaration of 'LICE_Copy'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(944) : error C2365: 'LICE_DrawChar' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(446) : see declaration of 'LICE_DrawChar'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(946) : error C2365: 'LICE_DrawGlyph' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(477) : see declaration of 'LICE_DrawGlyph'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(948) : error C2365: 'LICE_DrawRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(497) : see declaration of 'LICE_DrawRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(950) : error C2365: 'LICE_DrawText' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(448) : see declaration of 'LICE_DrawText'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(952) : error C2365: 'LICE_FillCircle' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(472) : see declaration of 'LICE_FillCircle'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(954) : error C2365: 'LICE_FillConvexPolygon' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(460) : see declaration of 'LICE_FillConvexPolygon'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(956) : error C2365: 'LICE_FillRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(408) : see declaration of 'LICE_FillRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(958) : error C2365: 'LICE_FillTrapezoid' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(459) : see declaration of 'LICE_FillTrapezoid'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(960) : error C2365: 'LICE_FillTriangle' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(462) : see declaration of 'LICE_FillTriangle'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(962) : error C2365: 'LICE_GetPixel' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(356) : see declaration of 'LICE_GetPixel'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(964) : error C2365: 'LICE_GradRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(402) : see declaration of 'LICE_GradRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(966) : error C2365: 'LICE_Line' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(454) : see declaration of 'LICE_Line'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(970) : error C2365: 'LICE_LoadPNG' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(320) : see declaration of 'LICE_LoadPNG'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(972) : error C2365: 'LICE_LoadPNGFromResource' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(322) : see declaration of 'LICE_LoadPNGFromResource'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(974) : error C2365: 'LICE_MeasureText' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(450) : see declaration of 'LICE_MeasureText'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(976) : error C2365: 'LICE_MultiplyAddRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(413) : see declaration of 'LICE_MultiplyAddRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(978) : error C2365: 'LICE_PutPixel' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(355) : see declaration of 'LICE_PutPixel'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(981) : error C2365: 'LICE_RotatedBlit' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(377) : see declaration of 'LICE_RotatedBlit'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(983) : error C2365: 'LICE_RoundRect' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(473) : see declaration of 'LICE_RoundRect'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(985) : error C2365: 'LICE_ScaledBlit' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(370) : see declaration of 'LICE_ScaledBlit'
1>C:\Program Files\Reaper4\reaper_plugin_functions.h(987) : error C2365: 'LICE_SimpleFill' : redefinition; previous definition was 'function'
1>        c:\projects\reaperdev\wdl\sws-extension\reaper\../../WDL/lice/lice.h(421) : see declaration of 'LICE_SimpleFill'
1>Build log was saved at "file://c:\Projects\ReaperDev\WDL\sws-extension\Test\BuildLog.htm"
1>SWS_Extension - 30 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any ideas what could be causing this?

I also noticed that as source file for the SWS extensions #includes afxres.h. I believe afxres is only available as part of some MSDN SDK that is not available in visual studio express. Can anyone confirm this? Does that mean that there's no way to build the sws extensions without Visual Studio Professional?
AudiOishi is offline   Reply With Quote
Old 11-21-2011, 08:44 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by AudiOishi View Post
I'm looking for an introduction to using the Reaper SDK, and as recommended, I'm looking at the SWS extensions as an example.
That wasn't a very good advice given to you. The SWS codebase is large and complicated. I can't even myself deal with it too well anymore even though I originally did large portions of it.

I'd recommend you rather start with the "random ninjam loop" example that comes with the Reaper extensions SDK, and start adding things to that(*). Of course if your goal is to work on fixing/extending the SWS extension, then it's a different matter and the best starting point probably is trying to get the SWS plugin compiled...

(*)Though I think also that relies on afxres.h, which is tricky to deal with the Express editions of Visual Studio.
__________________
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 11-22-2011, 11:16 AM   #3
AudiOishi
Human being with feelings
 
Join Date: Dec 2009
Posts: 50
Default

Quote:
(*)Though I think also that relies on afxres.h, which is tricky to deal with the Express editions of Visual Studio.
Sure enough!

Thanks for the input though.

I found that I am able to compile "example_m3u" in VS Express, so that's a good start.
AudiOishi is offline   Reply With Quote
Old 01-03-2013, 11:44 AM   #4
rekliner
Human being with feelings
 
Join Date: Jan 2013
Location: Nashville
Posts: 4
Default

I know it's more than a year late but I just went through your same issue. The redefinitions happen when you generate the reaper_plugins_functions.h while you already have reaper_sws.dll installed. You must first remove that DLL from the reaper plugins directory...THEN generate the API header. Otherwise it's putting references in reaper_plugins_functions.h to the same functions you are trying to build in the SWS project.
rekliner is offline   Reply With Quote
Old 01-09-2013, 01:12 AM   #5
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Guys, make sure you have read the Building wiki: https://github.com/Jeff0S/sws/wiki/B...-SWS-Extension
Everything is detailed there.

On a sidenote, I disagree with Xenakios, I find the SWS dead easy to setup/compil.
[EDIT].. but I agree this is not the best code to get started. Personnaly, I also started with the "random ninjam loop" example which is provided with the REAPER SDK[/EDIT]

Also, what rekliner says is totally right, tbut he OP's issue had nothing to do that (nor with afxres.h/winres.h issues) but with some WDL/LICE funcs redefinitions that we have fixed a long time ago.
(BTW, I remember this thread and why I did not reply at the time: we can read "[...]\wdl\sws-extension\reaper[...]" in the compil errors, which is a very weird dev directory structure..

Probable pitfalls when you have not read the wiki:
  • not needed anymore since REAPER v4.72+:
    On Win/OSX: as rekliner said, make sure you have uninstalled the sws extension before generating the API (i.e. before you run the action "[developer] Write C++ API functions header")
  • not needed anymore with the last WDL:
    On OSX: you have to SVN patch Cockos' WDL as explained, the extension will compile fine but will be totally buggy otherwise
  • On Win: make sure to define REAPER_DIR (and/or REAPER64_DIR) env var
  • On Win: if you have any compil issue with "winres.h", get in touch (PM)

BTW, we need more contributors in the open source, you're welcome!

Last edited by Jeffos; 08-16-2014 at 12:21 PM. Reason: new wiki URL, outdated stuff
Jeffos is offline   Reply With Quote
Old 08-16-2014, 03:37 AM   #6
Lostz
Human being with feelings
 
Lostz's Avatar
 
Join Date: May 2012
Location: Italy - Austria
Posts: 55
Default

Quote:
Originally Posted by Jeffos View Post
Guys, make sure you have read the Building wiki: http://code.google.com/p/sws-extension/wiki/Building
Everything is detailed there.
Hi JeffOS, thanks for the wiki, but I'm a little bit in doubt with these:
Quote:
/<development root>/sws/reaper/ - REAPER SDK interface / files
I need to extract the reaper_extension_sdk.zip here?

Thanks.
__________________
Thanks.
Lostz is offline   Reply With Quote
Old 08-16-2014, 07:06 AM   #7
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

ah no, you do not need anything from the REAPER SDK since the only file you need (reaper_plugin.h) is included in the SWS source tree, with permission. It's also newer than the SDK one.

I've updated some outdated stuff in my above post, just updated the wiki too, and its URL BTW (we've moved to github in the meantime...)
=> https://github.com/Jeff0S/sws/wiki/B...-SWS-Extension

Last edited by Jeffos; 08-16-2014 at 07:25 AM. Reason: outdated stuff in my above post
Jeffos is offline   Reply With Quote
Old 08-16-2014, 06:53 PM   #8
vtsaran
Human being with feelings
 
Join Date: Jan 2011
Posts: 64
Default Compiling SWS extension with Xcode 5.1 or higher

Hi,
It is increasingly impossible to maintain both Xcode 3.x and 5.1 on the same Mac OS any more. When I attempt to compile SWS extension with 5.1, I naturally get a lot of errors.
What are the major differences here to prevent SWS from compiling in Xcode 5.1?

Thanks,
V
__________________
--- --- ---
Visit me at https://www.youtube.com/vtsaran
vtsaran is offline   Reply With Quote
Old 08-17-2014, 12:27 AM   #9
Lostz
Human being with feelings
 
Lostz's Avatar
 
Join Date: May 2012
Location: Italy - Austria
Posts: 55
Default

Quote:
Originally Posted by Jeffos View Post
ah no, you do not need anything from the REAPER SDK since the only file you need (reaper_plugin.h) is included in the SWS source tree, with permission. It's also newer than the SDK one.
Thanks.

One more question:
How to set a Windows REAPER_DIR/REAPER64_DIR?
__________________
Thanks.
Lostz is offline   Reply With Quote
Old 08-17-2014, 05:04 AM   #10
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by Lostz View Post
How to set a Windows REAPER_DIR/REAPER64_DIR?
These are "environment variables", they must point to the path where REAPER 32-bit resides (or REAPER 64-bit, respectively). On Windows, they are required to build SWS. To define them see: http://www.itechtalk.com/thread3595.html. On OS X, those vars are optional. On Marvericks, I had to add them in /etc/launchd.conf (which isn't POSIX compliant, I think...)

Anyway, as a bonus on both OS's, when those env. vars REAPER_DIR and REAPER64_DIR are defined, REAPER v4.72+ will also generate the up-to-date API functions header (reaper_plugin_functions.h) where it should, by default -- good to know for all extension plugins, not only SWS

Quote:
Originally Posted by vtsaran View Post
Hi,
It is increasingly impossible to maintain both Xcode 3.x and 5.1 on the same Mac OS any more. When I attempt to compile SWS extension with 5.1, I naturally get a lot of errors.
What are the major differences here to prevent SWS from compiling in Xcode 5.1?
Hard to tell w/o the exact error messages...
On top of my head, the most probable reason is that XCode5 doesn't come with all needed OS X SDKs (down to 10.5).

If you do not plan to contribute the SWS open source, but just mess around, you can probably workaround this in the XCode project properties: just define a higher Base SDK and Deployment target.

If you want to fix things properly, and since you already have XCode3 installed, you can probably share the needed SDKs thanks to a trick like: http://stackoverflow.com/questions/5...ort-to-xcode-4 (for XCode4, but should work for 5 too).

Personally, I've never used XCode3. I'm using XCode 5.0.2 and everything compiles smoothly out of the box (using the SWS XCode 3.1 project, I mean). I just had to install all missing SDKs via http://devernay.free.fr/hacks/xcodelegacy/ (<- this link saved my butt!!)
Then, the only thing I had to tweak is: project properties > LLVM 5.0 Objective C > Implicitly Link Objective-C Runtime Support, set this to "No".

HTH!

Last edited by Jeffos; 08-17-2014 at 05:09 AM.
Jeffos is offline   Reply With Quote
Old 04-26-2016, 05:17 PM   #11
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

bumping this as it seems to be the most fitting thread I've found about building SWS extensions...

So I just tried to build it and it worked at first try, nice. Thanks for the building Wiki.
(using VS 2015 CE)

Only warnings I got are:

Quote:
1> 'php' is not recognized as an internal or external command,
1> operable program or batch file.
1>EXEC : warning : reascript_vararg.h generation failed (PHP installed?)
Quote:
1> 'perl' is not recognized as an internal or external command,
1> operable program or batch file.
1>EXEC : warning : sws_python.py generation failed (Perl installed?)
Quote:
warning BK4504: file contains too many references; ignoring further references from this source
last one I saw mentioned by Breeder here

http://forum.cockos.com/showpost.php...68&postcount=6


Are these warnings relevant (in which cases), and if so, how to fix (i.e. is it mandatory to install PHP and Perl) ?

(The built .dll seems to work fine in Reaper so far)

Last edited by nofish; 04-26-2016 at 06:14 PM.
nofish is offline   Reply With Quote
Old 04-27-2016, 11:35 AM   #12
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Got it going. Wasn't that hard actually.



The Perl error went away when having Perl installed (obviously).
I think PHP I only need installed when exporting SWS functions to ReaScript, is that correct ?
So probably no need for now.

Looking forward to contributing to SWS extensions (maybe, we'll see).
nofish is offline   Reply With Quote
Old 04-27-2016, 02:05 PM   #13
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by nofish View Post
Looking forward to contributing to SWS extensions (maybe, we'll see).
Please let me know where you get.

I still am interested in becoming the maintainer of LiveConfigs.

The major step to this would be to split SWS in multiple parts (i.e. Resaper API plugins), so that each of them can be separately maintained by an interested person.

What do you think ?

-Michael
mschnell is online now   Reply With Quote
Old 04-27-2016, 02:44 PM   #14
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 mschnell View Post
Please let me know where you get.

I still am interested in becoming the maintainer of LiveConfigs.

The major step to this would be to split SWS in multiple parts (i.e. Resaper API plugins), so that each of them can be separately maintained by an interested person.

What do you think ?

-Michael
Well, I just got my feet wet with SWS extensions, so it's far too early for me to give an educated opinion. Maybe rather talk to Jeffos (and other SWS contributors) about it.
nofish 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 02:44 AM.


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