# Compile Plugin for Linux

**URL:** <https://forum.xojo.com/t/compile-plugin-for-linux/8824>\
**Category:** Plugins\
**Created:** [June 13, 2013, 1:18am UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824 "2013-06-13T01:18:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandro\_Correa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@Sandro\_Correa](https://forum.xojo.com/u/Sandro_Correa)\
**Post date:** [June 13, 2013, 1:18am UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/1 "2013-06-13T01:18:38Z")

</div>

Hi, I have a plugin with some functions compiled and tested for Windows (Visual Studio Express) and OSX (Xcode), and I want to compile an application that use these plugin for Linux, how to compile my C / C++ code in Linux, so I can generate my Plugin for Linux too?

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [June 13, 2013, 1:48am UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/2 "2013-06-13T01:48:31Z")

</div>

Have you got any of the dev tools installed on Linux ?

You’ll need gcc then compile a shared library so you generate a .so file as the linux portion of the plugin

---

<div class="post-metadata">

**Author:** ![Sandro\_Correa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@Sandro\_Correa](https://forum.xojo.com/u/Sandro_Correa)\
**Post date:** [June 13, 2013, 7:20pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/3 "2013-06-13T19:20:01Z")

</div>

Yes, I have gcc installed on Linux, but, my question is: PluginMain is c++ code. So, I think gcc won’t work with it, am I wrong? What do I have to include (.h) to my sources? Do I have to make some kind of changes on my code, or set some kind of environment variables? (on Windows, I had to set IGNOREQT on Visual Studio).

Thanks for Your help!

---

<div class="post-metadata">

**Author:** ![Sandro\_Correa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@Sandro\_Correa](https://forum.xojo.com/u/Sandro_Correa)\
**Post date:** [June 13, 2013, 7:21pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/4 "2013-06-13T19:21:13Z")

</div>

Is there any readme for Linux, like the one for Visual Studio, present on the examples?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [June 13, 2013, 7:26pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/5 "2013-06-13T19:26:02Z")

</div>

you could start and check the examples coming with SDK. you compile with makefile and there you can define something. I define LINUX=1 for linux, so I can use #if LINUX there.

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [June 13, 2013, 7:44pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/6 "2013-06-13T19:44:21Z")

</div>

GCC have a CPP frontend. Check the Eye Control example. Here is the make file (you can notice the g++ there):

[code]# Makefile\_Linux | Sep 08 2011

# 

# This is the Linux makefile for the EyeControl plugin.

# 

# Document Author: William Yu

# Document Contributor(s):

# 

# Revision History

CC = g++  
BASEDIR = …/…/…  
PLUGINSDKDIR = $(BASEDIR)/Plugins\ SDK  
SDKGLUECODEDIR = $(PLUGINSDKDIR)/Glue\ Code  
SDKINCLUDEDIR = $(PLUGINSDKDIR)/Includes

INCLUDE = -I$(SDKINCLUDEDIR)

PREFIXHEADER = $(SDKINCLUDEDIR)/LinuxHeader.h  
CFLAGS = -s -O2 -DIGNOREQT -D\_\_INTEL\_\_ -DLINUX=1 -D\_\_GCC\_\_ $(INCLUDE) -include $(PREFIXHEADER)  
LIBS =  
BUILDOBJDIR = BuildLinux

OBJS = $(BUILDOBJDIR)/EyeControlPlugin.o \  
$(BUILDOBJDIR)/PluginMain.o

all: CreateBuildObjDir $(OBJS)  
$(CC) $(CFLAGS) -shared -o EyeControl.so $(OBJS) $(LIBS)

CreateBuildObjDir:  
mkdir -p $(BUILDOBJDIR)

$(BUILDOBJDIR)/EyeControlPlugin.o: EyeControlPlugin.cpp  
$(CC) $(CFLAGS) EyeControlPlugin.cpp -c -o $@

$(BUILDOBJDIR)/PluginMain.o: $(SDKGLUECODEDIR)/PluginMain.cpp  
$(CC) $(CFLAGS) $(SDKGLUECODEDIR)/PluginMain.cpp -c -o $@

clean:  
rm $(BUILDOBJDIR)/\*.o -f  
rm EyeControl.so  
[/code]

---

<div class="post-metadata">

**Author:** ![Sandro\_Correa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@Sandro\_Correa](https://forum.xojo.com/u/Sandro_Correa)\
**Post date:** [June 14, 2013, 2:55pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/7 "2013-06-14T14:55:09Z")

</div>

Ok, now I’ve got it!

Thank You all!!!

---

<div class="post-metadata">

**Author:** ![Sandro\_Correa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@Sandro\_Correa](https://forum.xojo.com/u/Sandro_Correa)\
**Post date:** [June 21, 2013, 5:32pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/8 "2013-06-21T17:32:26Z")

</div>

Hi, I’ve compiled the plugin and maked the .rbx successfully, but when I build my application and try to run on a Linux machine, it returns this error:

Runtime Error  
Please report what caused this error along with the information below.  
Common/plugin.cpp: 5327  
Failure Condition: 0  
The application cannot continue because a needed file cannot be installed. /home/sandro/MyApplication/MyApplication Libs/libbds.so: undefined symbol: mod10

Any ideas?

---

<div class="post-metadata">

**Author:** ![William\_Yu](https://forum.xojo.com/user_avatar/forum.xojo.com/william_yu/32/610_2.png) [@William\_Yu](https://forum.xojo.com/u/William_Yu)\
**Post date:** [August 29, 2013, 7:41pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/9 "2013-08-29T19:41:21Z")

</div>

Try adding the --no-undefined flag here:  
$(CC) $(CFLAGS) -shared -Wl,–no-undefined -o EyeControl.so $(OBJS) $(LIBS)

Basically you’re referencing a function that does not exist in your library. That flag will tell you where you’re using it and flag it as a compile error.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:42pm UTC](https://forum.xojo.com/t/compile-plugin-for-linux/8824/10 "2020-10-29T16:42:34Z")

</div>


