今天又搞到个libDTL.so is not an ELF file - it has the wrong magic bytes at the start.
2011-09-21 13:47
525 查看
最初编译生成的libDTL.a是拷贝到/usr/lib并设置软连接
然后把/lib中的.a文件删除,又试试添加库文件搜索路径,于是
xia@ubuntu:~$ gedit .bashrc
然后末尾添加库的搜索路径
LD_LIBRARY_PATH=$/home/xia/dtl37/lib:$LD_LIBRARY_PATH
exportLD_LIBRARY_PATH
xia@ubuntu:~$ sudo gedit /etc/ld.so.conf
然后可以看到文件本身内容如下:.
我们将/home/xia/dtl37/lib/debug下的libDTL.a拷贝到/home/xia/dtl37/lib下,并在ld.so.conf下添加/home/xia/dtl37/lib目录。这里为什么是这个目录而不是debug目录呢?因为DLT需要的文件都在lib,而不是在debug下。
不过在添加/home/xia/dtl37/lib后,执行lnconfig出现如题的警告:
libDTL.so is not an ELF file - it has the wrong magic bytes at the start.
一搜,各种人遇到的问题,不过貌似没有一样的,哈哈,I am a trouble maker ?
关于/etc/ld.so.conf文件,可以参考http://blog.sina.com.cn/s/blog_4cce4f6a0100ms6f.html
不过经过测试,以上方法不行,依旧采用直接拷贝libDTL.a文件到/lib文件夹。
综上所述,菜鸟之乱搞,总是很有惊喜的
xia@ubuntu:~/dtl37/lib$ ln -s libDTL.a libDTL.so实际上在这硬链接也行,实际上直接拷贝.a过去也行的,哎,当初多此一举了。不过对/usr/lib和/lib这种系统文件夹进行手动修改,总是不和谐的,所以以前虽然搞定了,现在突然回头搞一搞。
然后把/lib中的.a文件删除,又试试添加库文件搜索路径,于是
xia@ubuntu:~$ gedit .bashrc
然后末尾添加库的搜索路径
LD_LIBRARY_PATH=$/home/xia/dtl37/lib:$LD_LIBRARY_PATH
exportLD_LIBRARY_PATH
xia@ubuntu:~$ sudo gedit /etc/ld.so.conf
然后可以看到文件本身内容如下:.
我们将/home/xia/dtl37/lib/debug下的libDTL.a拷贝到/home/xia/dtl37/lib下,并在ld.so.conf下添加/home/xia/dtl37/lib目录。这里为什么是这个目录而不是debug目录呢?因为DLT需要的文件都在lib,而不是在debug下。
不过在添加/home/xia/dtl37/lib后,执行lnconfig出现如题的警告:
libDTL.so is not an ELF file - it has the wrong magic bytes at the start.
一搜,各种人遇到的问题,不过貌似没有一样的,哈哈,I am a trouble maker ?
关于/etc/ld.so.conf文件,可以参考http://blog.sina.com.cn/s/blog_4cce4f6a0100ms6f.html
不过经过测试,以上方法不行,依旧采用直接拷贝libDTL.a文件到/lib文件夹。
综上所述,菜鸟之乱搞,总是很有惊喜的
相关文章推荐
- suse 11安装db2时The 32-bit library file libpam.so is not found on the system.
- SAPUI5教程——The project is corrupted because its '.user.project.json' file has an invalid JSON
- The Tomcat installation directory is not valid. It is missing expected file or folder lib/jasper-el
- The Tomcat installation directory is not valid. It is missing expected file or folder lib/jasper-el
- android studio :The file is not part of the project.Please include it
- Column \'表名.某列名\' is invalid in the select list because it is not contained in either an aggregate f
- invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
- Eclipse上JPA报错:Target Entity is not a entity 和the "mapped by" attribute has an invalid mapping type
- Eclipse错误提示:The project was not built since its build path is incomplete. Cannot find the class file
- JAVA Error:The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry.....
- Qt5:"Designer: An error has occurred while reading the UI file at line 1, column 0: Premature end of document."错误
- The MySQL server is running with the --secure-file-priv option so it cannot execute this statement解决
- Database 'xxx' cannot be upgraded because it is read-only or has read-only file Make the database or files writeable, and rerun recovery.
- The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object
- The project was not built since its build path is incomplete. Cannot find the class file for java.la
- Apache 安装过程中出错/usr/lib/libexpat.so: could not read symbols: File in wrong format的解决办法
- PHPExcel的exception 'Exception' with message 'The filename is not recognised as an OLE file问题解决
- JAVA Error:The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry.....
- couldn't find "libxxx.so"与"libxxx.so" is too small to be an ELF executable解决方法
- Incorrect decrement of the reference count of an object that is not owned at this point by the caller1