cppcomponents icon indicating copy to clipboard operation
cppcomponents copied to clipboard

When compiled with GCC 6.2.1 the same plugin is loaded twice

Open hhyyrylainen opened this issue 9 years ago • 0 comments

In the example if I change the build script from clang++ to g++ for the plugins, the same plugin is loaded twice. After loading both plugin1 and plugin2 with clang the command list in the example is this:

Command1
Command2
Command3
Command4

The same thing but all the files compiled with GCC:

Command1
Command2

This is the modified build script:

g++ -std=c++11 -I ../../ main.cpp -o main -ldl -pthread

g++ -std=c++11 -I ../../ plugin1.cpp -shared -fPIC -o plugin1.so
g++ -std=c++11 -I ../../ plugin2.cpp -shared -fPIC -o plugin2.so

Originally I encountered this when trying to add a second plugin to my own project, but it kept loading the first one twice. I tried both the static functions and creating a dynamic instance.

hhyyrylainen avatar Nov 12 '16 18:11 hhyyrylainen