COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 07-26-2018, 02:44 PM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default Building SWELL project in Linux: Which .o files should be linked?

I am trying to build a C++ SWELL project in Linux, in order to test some of the window-related functions.
For example, this is the simple test.cpp file that is included in the WDL/swell folder:
Code:
#include "swell.h"

int main()
{
  MessageBox(NULL,"hello world","a",0);
  return 0;
}
Compiling the files seem to work fine: When I run make, I get libSwell.so as well as a lot of swell-...o and lice-...o files, without any warning messages.

However, when I try to link test.o and the other object files, I just get endless lists of "undefined reference" errors like these:
Code:
swell-generic-gdk.o: In function `SWELL_GetViewPort(RECT*, RECT const*, bool)':
swell-generic-gdk.cpp:(.text+0x2f01): undefined reference to `gdk_screen_get_default'
swell-generic-gdk.cpp:(.text+0x2f3a): undefined reference to `gdk_screen_get_monitor_at_point'
swell-generic-gdk.cpp:(.text+0x2f5e): undefined reference to `gdk_screen_get_monitor_geometry'
Am I missing some object files? Which object files are required for a simple SWELL project?
juliansader is offline   Reply With Quote
Old 07-26-2018, 11:46 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

These undefined reference means you also need to link against GDK.

However, is your goal making a REAPER extension? If so, it's best to rely on REAPER providing the implementation of SWELL functions instead of building a copy of them into the extension (for example, this allows using REAPER cursors).

To do that, define SWELL_PROVIDED_BY_APP and only build swell-modstub-generic.cpp.
cfillion is offline   Reply With Quote
Old 08-03-2018, 12:40 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Ah, I didn't realize that SWELL needs to be linked against several non-WDL libraries. I got everything to build by using:
Code:
*.o -ldl -lXi -lX11 -lfreetype `pkg-config --cflags --libs gtk+-3.0`
(with *.o being all the .o files created by the makefile).
juliansader 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 09:05 AM.


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