Linux build error in PluginMain.cpp

Using Ubuntu Linux 14.04 I’m getting this build error in PluginMain.cpp:

error: expected unqualified-id before string constant
attribute((visibility(“default”))) extern “C” void REALPluginMain(void *(*resolver)(const char *entryName));

How can I resolve this error?

What compiler are you using?

I’m using the Ubuntu Linux installed by Parallels on an iMac. The Terminal program is what I used. I know it recognizes g++, and I assume it’s the GNU C++ compiler.

I’m assuming you have a makefile that’s invoking gcc? Could you post that and the output of “g++ -v” somewhere?

output of g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 4.8.4-2ubuntu1~14.04’ --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

and here’s the makefile:

makefile

Usage:

make all

This is the makefile for the fp Plugin.

CC = g++ -m32

BASEDIR = /home/parallels/Desktop/RMDProjects

PLUGINSDKDIR = $(BASEDIR)/RBplugins

SDKGLUECODEDIR = $(PLUGINSDKDIR)/Glue\ Code

SDKINCLUDEDIR = $(PLUGINSDKDIR)/Includes

INCLUDE = -I$(SDKINCLUDEDIR)

PERMISSIVEFLAG = -w -fpermissive
CFLAGS = -s -O2 -D__INTEL__ -D__GCC__ -DX_WINDOW=1 $(INCLUDE) $(ADDITIONALINCLUDES)
PREFIXHEADER = LinuxHeader.h

OBJS = fpPlugin.o BaseFromBase.o bessel.o betaFunctions.o DealWithGray.o diags.o ErrorFunctions.o euler.o expInt.o findPolyRoots.o fp.o fpComplex.o fpComplexConv.o fpComplexFuncs.o fpComplexMath.o fpConv.o fpFuncs.o fpMath.o fresnel.o GammaFunctionsC.o Gray_Binary.o hypergeometric.o Laguerre.o mb.o mb2Str.o mbConv.o mbMath.o mbMod.o mbRand.o myGammaFunctions.o stringUtils.o PluginMain.o

all: $(OBJS)
$(CC) $(CFLAGS) -shared -o libfpPlugin.so $(OBJS)

fpPlugin.o: fpPlugin.cpp
$(CC) $(CFLAGS) -include $(PREFIXHEADER) fpPlugin.cpp -c

BaseFromBase.o: BaseFromBase.cpp
$(CC) BaseFromBase.cpp -c

bessel.o: bessel.cpp
$(CC) bessel.cpp -c

betaFunctions.o: betaFunctions.cpp
$(CC) betaFunctions.cpp -c

DealWithGray.o: DealWithGray.cpp
$(CC) DealWithGray.cpp -c

diags.o: diags.cpp
$(CC) diags.cpp -c

ErrorFunctions.o: ErrorFunctions.cpp
$(CC) ErrorFunctions.cpp -c

euler.o: euler.cpp
$(CC) euler.cpp -c

expInt.o: expInt.cpp
$(CC) expInt.cpp -c

findPolyRoots.o: findPolyRoots.cpp
$(CC) findPolyRoots.cpp -c

fp.o: fp.cpp
$(CC) fp.cpp -c

fpComplex.o: fpComplex.cpp
$(CC) fpComplex.cpp -c

fpComplexConv.o: fpComplexConv.cpp
$(CC) fpComplexConv.cpp -c

fpComplexFuncs.o: fpComplexFuncs.cpp
$(CC) fpComplexFuncs.cpp -c

fpComplexMath.o: fpComplexMath.cpp
$(CC) fpComplexMath.cpp -c

fpConv.o: fpConv.cpp
$(CC) fpConv.cpp -c

fpFuncs.o: fpFuncs.cpp
$(CC) fpFuncs.cpp -c

fpMath.o: fpMath.cpp
$(CC) fpMath.cpp -c

fresnel.o: fresnel.cpp
$(CC) fresnel.cpp -c

GammaFunctionsC.o: GammaFunctionsC.cpp
$(CC) GammaFunctionsC.cpp -c

Gray_Binary.o: Gray_Binary.cpp
$(CC) Gray_Binary.cpp -c

hypergeometric.o: hypergeometric.cpp
$(CC) hypergeometric.cpp -c

Laguerre.o: Laguerre.cpp
$(CC) Laguerre.cpp -c

mb.o: mb.cpp
$(CC) mb.cpp -c

mb2Str.o: mb2Str.cpp
$(CC) mb2Str.cpp -c

mbConv.o: mbConv.cpp
$(CC) mbConv.cpp -c

mbMath.o: mbMath.cpp
$(CC) mbMath.cpp -c

mbMod.o: mbMod.cpp
$(CC) mbMod.cpp -c

mbRand.o: mbRand.cpp
$(CC) mbRand.cpp -c

myGammaFunctions.o: myGammaFunctions.cpp
$(CC) myGammaFunctions.cpp -c

stringUtils.o: stringUtils.cpp
$(CC) stringUtils.cpp -c

PluginMain.o: $(SDKGLUECODEDIR)/PluginMain.cpp
$(CC) $(PERMISSIVEFLAG) $(CFLAGS) -include $(PREFIXHEADER) $(SDKGLUECODEDIR)/PluginMain.cpp -c

CLEAN:
rm $(OBJS)

This subject is now moot for me. Since my fp Plugin is purely mathematical, the Mac dylib can also be used as the Linux .so lib. So I don’t need a makefile for Ubuntu Linux anymore.

However, for applications using my plugin while 32-bit ones will build, 64-bit ones will not.

in my copy of the SDK I actually removed the "attribute((visibility(“default”))) " part from the declaration as my gcc doesn’t like it.