ld

linking problem, can't find symbol even though nm shows symbol in library

杀马特。学长 韩版系。学妹 提交于 2020-01-06 08:10:53
问题 I'm linking an app against lflutter_linux_glfw . nm tools shows it has glad_glTexImage2D : nm libflutter_linux_glfw.so | grep glTexImage2D 00000000034e87a0 b glad_glTexImage2D 00000000034e87a8 b glad_glTexImage2DMultisample So I included lflutter_linux_glfw.so before flutter_video_renderer.o , and I get this: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64

nasm and gcc: 32 bit linking failed (64 bit Mac OS X)

被刻印的时光 ゝ 提交于 2020-01-06 03:03:09
问题 I've just compiled a assembley file with nasm this way: $ nasm -f elf somefile.asm -o somefile.o After that I want to link somefile.o to a programm with gcc $ gcc -m32 somefile.o -o someprogramm But linking the file prints the following error: ld: warning: ignoring file somefile.o, file was built for unsupported file format which is not the architecture being linked (i386) Undefined symbols for architecture i386: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for

How to force nasm to address variables position-independent?

无人久伴 提交于 2020-01-04 05:35:13
问题 How to tell NASM (or LD) to process labels in a way that will make the segment position-independent? The segment is going to be moved from one file to another and I want it to work properly on any position in any file. Here is the code that illustrates my problem: section .text ... message: db 'hello world!',0x00 ... mov rax,SYSCALL_WRITE mov rdi,STDOUT mov rsi,message mov rdx,13 syscall In the orginal executable it prints "Hello world!", but when the segment is moved to another elf, it

How to control the symbol names when embedding data in an executable in Linux?

久未见 提交于 2020-01-03 18:34:08
问题 I need to embed some data into an executable or SO file on Linux. I've found I can do it with ld --format binary , however, all examples I've seen assume the data file is in the current directory. If it is not, then the resulting symbol name gets complicated, as it tries to include the full path to the file. Is there a way to provide a name for the symbol explicitly, for ex. Say symbol name for this data should be MyData ? Thanks 回答1: You definitely can not specify linker-generated binary

Duplicate definition for symbol __module_registered error

大兔子大兔子 提交于 2020-01-03 16:48:14
问题 I get an error message from GHCi about a "duplicate definition for symbol __module_registered", like this: GHCi runtime linker: fatal error: I found a duplicate definition for symbol __module_registered whilst processing object file /usr/local/lib/ghc-6.2/HSfgl.o How to fix this? 回答1: Thats is easy, probably indicates that when building a library for GHCi (HSfgl.o in the above example), you should use the -x option to ld. 来源: https://stackoverflow.com/questions/3392925/duplicate-definition

Xcode warning with non-standard Framework ld: warning: directory not found for option -F

此生再无相见时 提交于 2020-01-02 13:56:10
问题 Cleaning up warnings, I could see the following: ld: warning: directory not found for option '-F/myPath/etc/myframework' This was happening with non-standard iOS frameworks. How to eliminate the warning? 回答1: Checking the man page of the linker ld shows the following detail for the -Fdir option: Add dir to the list of directories in which to search for frameworks. Directories specified with -F are searched in the order they appear on the command line and before the default search path. In

GCC/LD cannot find link library

女生的网名这么多〃 提交于 2020-01-02 03:34:51
问题 OS: Windows 7 Enterprise x64 IDE: Eclipse Juno/CDT Compiler: MinGW 4.6.2 (C:\MinGW) Like user697111, I cannot get ld.exe to find an external library. Simple programs compile and link fine, but when I try to add SQL funcionality with the supplied library, I get this error message in Eclipse: "c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lC:\MinGW\lib\libodbc32.a". I specified C:\MinGW\lib as the Project Library Path. I specified C:\MinGW\lib\libodbc32.a as

How to add shared library search path to a executable file?

喜夏-厌秋 提交于 2020-01-02 01:55:16
问题 I build the ffmpeg with librtmp. My librtmp is at /opt/librtmp/lib. When I execute the ffmpeg, it said: ./ffmpeg: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory I use ldd command it displays not found : [qty@testing bin]# ldd ffmpeg linux-vdso.so.1 => (0x00007fff15576000) librtmp.so.0 => not found libz.so.1 => /lib64/libz.so.1 (0x00002b9a71e10000) libm.so.6 => /lib64/libm.so.6 (0x00002b9a72025000) libpthread.so.0 => /lib64

Linked cannot find symbols, but libraries are read and symbols exist

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 09:47:21
问题 I've been trying to compile my project and I'm getting undefined reference errors. eg.: installertest.cpp:(.text+0x9d1): undefined reference to `XmlRpcValue::makeArray()' ... installertest.cpp:(.text+0xede): undefined reference to `dbcancel' installertest.cpp:(.text+0xefd): undefined reference to `dbfcmd' installertest.cpp:(.text+0xf0f): undefined reference to `dbsqlexec' installertest.cpp:(.text+0xf2d): undefined reference to `SHA1_Init' ... My command-line is: g++ -o installertest \ -lsybdb

gccgo on Precise

我与影子孤独终老i 提交于 2020-01-01 09:03:25
问题 When trying to link with gccgo on Precise, I get this linking error: matt@matt-1005P:~/src/gopath/src/meme$ gccgo cmd/meme/main.go -o meme /usr/bin/ld: cannot find -lgcc_s collect2: error: ld returned 1 exit status There are reports of this error, but no clean solutions. How do I fix it? gccgo (Ubuntu/Linaro 4.7.0-0ubuntu4) 4.7.0 Linux matt-1005P 3.2.0-24-generic-pae #38-Ubuntu SMP Tue May 1 16:40:26 UTC 2012 i686 i686 i386 GNU/Linux 回答1: This was recently brought up on the golang-nuts group: