Netbeans:加载共享库时出现错误:libucu .so.不能打开共享对象文件:没有这样的文件或目录

Netbeans: error while loading shared libraries: libicuuc.so.50: cannot open shared object file: No such file or directory

本文关键字:文件 共享 对象 不能 加载 错误 Netbeans so libucu      更新时间:2023-10-16

我试图在Ubuntu下使用Netbeans c++(7.3)的ICU-Timezone API。

我已经为ICU添加了libraries和include目录。

然后我想执行这个简单的示例代码:

#include <ctime>
#include <stdlib.h>
#include <stdio.h>
#include "DateFormats.h"
#include "NumberFormats.h"
#include <time.h>
#include <unistd.h>
#include <getopt.h>
#include <timezone.h>
using namespace std;
int main(int argc, char **argv) {
    cout<<"hello"<<endl;
    TimeZone *tz = TimeZone::createTimeZone("America/Los_Angeles");  
}

我得到错误

/home/ubuntu/NetBeansProjects/DFC/dist/Debug/GNU-Linux-x86/DFC:加载共享库时出现错误:libicucu .so。无法打开共享目标文件:没有这样的文件或目录

希望你能帮助我!

谢谢Florian

run following command is fine

export LD_LIBRARY_PATH=/usr/local/lib

或者您可以使用vi永久地添加

到文件中

vi ~/.bashrc