Segmentation Fault (SIGSEGV) while calling <libname>Initialize() Matlab 2012a Linux 64bit
4 ビュー (過去 30 日間)
古いコメントを表示
Hi
I have a c++ project, that uses a Matlab generated shared library, to generate I&Q samples for tranmitting on DVB-RCS system. I use Ubuntu 12.04
First I have been using this library successfuly under Windows (within the same c++ project). Now I need to make it work under linux. The problem arise on initializing the library. To simplify, I have created a very basic Matlab project (that prints "Hello World") to be sure that it's not my code which is wrong. But the segmentation fault still occurs on libhelloInitialize(). So I guess the problem I have is related to linking ? or linking conflict ?
I use
mclInitializeApplication(Null, 0)
before initializing the lib
I also tried :
const char *a[] = { "-nodisplay", "-nojvm", "-logfile", "error.txt" };
mclInitializeApplication(a,4)
I build the library with : mcc -m hello.m
I also created a stand-alone executable using mcc -m hello.m. It runs fine I tried to compare the dependencies using ldd, and everyting seamed ok. Thought something was a bit strange, in the differences of dependencies between the hello stand-alone application and hello.so. the app uses boost library (c++ lib) and standard C++ lib that come from where matlab is installed. The shared lib is NOT linked to any boost, and to standard c++ lib of my system (/usr/lib). Would this difference be the root of my problem ?
I have ensured to use the compatible version of gcc (4.4.7 as in the doc), and I have run mcc -setup
Since the stand-alone application creation works fine, it must be related to linking process or runtime search for shared library. In the project that call the libhelloInitialize(), I use the same gcc as in matlab, and I link to boost c++ lib. Could it be some interferences ? I also use the UHD for USRP (<http://ettus-apps.sourcerepo.com/redmine/ettus/projects/uhd/wiki>) can on of these create a name conflict or something ?
I can provide any additional info if necessary (code, ldd output, etc...).
回答 (1 件)
Gunnar
2012 年 10 月 8 日
2 件のコメント
Walter Roberson
2012 年 10 月 8 日
The MATLAB Answers facility is responded to by users around the world who volunteer, not by Mathworks support staff. If the volunteers do not know the answer, or if your question happens to get overlooked by a volunteer who does know something about the topic, then you might not happen to get an answer.
You can get more reliable support by using Mathworks Technical Support.
参考
カテゴリ
Help Center および File Exchange で C Shared Library Integration についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!