COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 05-23-2021, 12:10 AM   #1
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default How to use Swell?

How to use Swell for OSX?

I can not compile the plugins or any application if I add Swell. I tried everything: IPlug 2, Oli and Tale version.

Where do I find instructions on how to use it? I added the Swell directory to the project and I inserted #include "swell.h" but receive lot of errors in XCode like:

Code:
error: invalid use of incomplete type 'struct HWND__'
error: forward declaration of 'struct HWND__'
error: invalid use of incomplete type 'struct HWND__'
TonyGlover is offline   Reply With Quote
Old 05-23-2021, 02:37 AM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,213
Default

I think I include only specific parts of SWELL in my IPlug version, namely:
  • swell.h
  • swell-gdi.mm
  • swell-internal.h
Tale is offline   Reply With Quote
Old 05-23-2021, 04:48 AM   #3
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default

The error has changed: duplicate symbol SelectObject(HDC__*, HGDIOBJ__*)
TonyGlover is offline   Reply With Quote
Old 05-23-2021, 08:09 AM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,604
Default

If it's for use in a REAPER plugin: don't build any of the SWELL source files. The implementation of the SWELL functions should be loaded at runtime from REAPER instead. (So that future updates to SWELL are applied to the plugin, and to reduce unnecessary duplication.)

Define SWELL_PROVIDED_BY_APP before including swell.h and only build the loader: swell-modstub.mm (swell-modstub-generic.cpp on Linux).
cfillion is offline   Reply With Quote
Old 05-23-2021, 09:34 AM   #5
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default

Error again
TonyGlover is offline   Reply With Quote
Old 05-25-2021, 03:30 AM   #6
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default

I just managed to reduce the number of errors to one:

swell-gdi.mm:162: error: conversion from 'objc_object*' to non-scalar type '_NSRect' requested

This error occurs when I try to compile the sample_project from WDL>Swell
TonyGlover is offline   Reply With Quote
Old 05-28-2021, 04:50 PM   #7
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,242
Default

IPlug2 app target is using swell. It's a good example to follow. Or you can look at the swell sample_project in WDL or the lice demo.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-04-2021, 04:46 AM   #8
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default

I added swell-modstub.mm to the project to be compiled. I added to the header file of the plugin #include "../../../WDL-tale/WDL/swell/swell.h"
But I receive this error:
Code:
  "SWELL_LoadCursor(char const*)", referenced from:
      MyBar::ValToMouse(int, int, bool, bool)in Main.o
ld: symbol(s) not found
If I add swell-kb.mm the project to be compiled. I get this error:
Code:
  "SWELL_CStringToCFString(char const*)", referenced from:
      swell_imageFromCursorString(char const*, POINT*)in swell-kb.o
      swell_imageFromCursorString(char const*, POINT*)in swell-kb.o
  "GetTickCount()", referenced from:
      swell_imageFromCursorString(char const*, POINT*)in swell-kb.o
  "GetTempPath(int, char*)", referenced from:
      swell_imageFromCursorString(char const*, POINT*)in swell-kb.o
  "GetModuleFileName(void*, char*, unsigned int)", referenced from:
      swell_imageFromCursorString(char const*, POINT*)in swell-kb.o
ld: symbol(s) not found
TonyGlover is offline   Reply With Quote
Old 06-04-2021, 05:10 AM   #9
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,242
Default

you're on the right track. The compiler reports missing symbols, so you need to add the implementation file with those missing things.

SWELL_CStringToCFString is in swell-misc.mm

https://github.com/justinfrankel/WDL...ll-misc.mm#L87

If you don't compile that with your code you'll get an error.


BUT - if you are trying to do something with modstub, you have to link against swell.dylib, rather than compiling swell-misc.mm etc with your project

https://github.com/justinfrankel/WDL...modstub.mm#L29
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-04-2021, 08:39 AM   #10
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,604
Default

Quote:
Originally Posted by TonyGlover View Post
I added swell-modstub.mm to the project to be compiled. I added to the header file of the plugin #include "../../../WDL-tale/WDL/swell/swell.h"
But I receive this error:
Code:
  "SWELL_LoadCursor(char const*)", referenced from:
      MyBar::ValToMouse(int, int, bool, bool)in Main.o
ld: symbol(s) not found
Was SWELL_PROVIDED_BY_APP defined before main.cpp included swell.h?
cfillion is offline   Reply With Quote
Old 06-04-2021, 10:43 AM   #11
TonyGlover
Human being with feelings
 
TonyGlover's Avatar
 
Join Date: Mar 2016
Posts: 53
Default

Quote:
Originally Posted by olilarkin View Post
you're on the right track. The compiler reports missing symbols, so you need to add the implementation file with those missing things.

SWELL_CStringToCFString is in swell-misc.mm

https://github.com/justinfrankel/WDL...ll-misc.mm#L87

If you don't compile that with your code you'll get an error.


BUT - if you are trying to do something with modstub, you have to link against swell.dylib, rather than compiling swell-misc.mm etc with your project

https://github.com/justinfrankel/WDL...modstub.mm#L29
Thanks Oli, worked

I added swell-misc.mm and swell.cpp.

Thanks to everyone for your great help!!!
TonyGlover 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 11:11 AM.


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