On Saturday 27 May 2017 11:48:38 vijay krishnavanshi wrote: > Hi, > > I am facing an issue with one of the cmake module build. The issue is about > the classes and library handling. I am making a derived class and am unable > to call the function of the base class in it. It has something to do with > CMake build. I went through the stack overflow and it says that it happens > when compiler is not able to see the included library file. I have also > pasted the files in the pastebin which I think will describe the issue. > > Link to Error Log: https://pastebin.com/UnMTuZBH > Link to tests/latex/CMakeLists.txt: https://pastebin.com/NFX5nTK2 > Link to tests/latex/testLatexPlugin.cpp: https://pastebin.com/Y8MgeDhs > > Test case for three plugins are done. I have tried to keep the logs short. > > If this is ambiguous, Should I create a Review Request and describe the > issue? > > I know this needs to be figured out by me and I am doing it. But I thought > its better to ask for help :) > > Regards, > Vijay Krishnavanshi
Hi! Looks like problem is that symbol for your testing function is not exported from shared plugin library. If some function symbol is not exported from plugin library, then application which loads that plugin library cannot call that function. On the other hand, plugin library itself can call that function. Normally plugin libraries should export only those symbols which are part of public plugin interface API/ABI, not more. Other function are marked as "private" for plugin and do not have any defined API/ABI for interaction between plugin and application. In your case, that function is not part of API/ABI between plugin & application and therefore should not be exported from plugin. So I think it is correct behaviour that you get problems with missing symbol. But you are writing tests for those "private" plugin functions and you need to call them. I do not know what is correct way how to achieve it, but marking "private" plugin function as exportable and make it public for application is a really bad idea. What should work is to statically compile plugin into your testing binary. E.g. compile all source code files (plugin files + testing application) in one step into one executable binary. -- Pali Rohár pali.ro...@gmail.com