Hi,
I'm having a lot of trouble compiling the otherwise excellent Contiki OS on my macbook pro (with mac os x 10.6). Contiki actually uses a lot of GNU-specific features and options of GCC, AR, LD, and so on. So I installed those utilities via macports, but it looks like "port install binutils" does not install GNU ld, does it ?
So, th...
I am writing a fairly large C++ shared-object library, and have run into a small issue that makes debugging a pain:
If I define a function/method in a header file, and forget to create a stub for it (during development), since I am building as a shared object library rather than an executable, no errors appear at compile-time telling me...
ld: foo.o: relocation R_X86_64_PC32 against undefined symbol `bar' can not be used when making a shared object; recompile with -fPIC
I recompile with -fPIC and it still produces this error.
...
Is it possible to make a shared library in which exist some function that are not implemented?
I'l like to make a shared library testDele.so and leave some of the functions in the testDele.so to be implimented by other people for example:
library provider make the files:
====== testDele.c ==============
#include <stdlib.h>
#include...
While compiling my program which is using libevent library I am using gcc option -levent. But I am getting this error -
/usr/bin/ld: cannot find -levent
I do not have libevent on my system so I am statically linking to it while compiling using
gcc -o Hello -static -I libevent-1.4.12-stable/ hello.c -levent
How can i resolve this?
...
I detect this using strace:
8480 execve("/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld",
[ "/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld",
...
"-L/home/bjack/lib",
...
"-rpath-link", "/root/src/firmware/Bj-bg/ab-BJ-gameprom-modules/src/dis...
I want to create a shared library that uses functions from a 3rd-party static library. For example, foo and bar from libfoobar.a. I know that my main application is also using foo and will be exporting that symbol. So I simply want to link in bar to save code size and leave 'foo' unresolved (as it will be provided by main application). I...
How do I make Xcode link object files properly?
The file containing "main" and all the dependencies compile properly (and I can easily link them in the command line to generate the executable). However, Xcode seems to refuse to do it, resulting in ld errors of "symbol not found".
This is what my current setup looks like. All the depend...
I have a problem with python-config --ldflags on OS X 10.6.2.
Using my non-system python.org python install:
robin-mbp:~ robince$ which python
/Library/Frameworks/Python.framework/Versions/2.5/bin/python
robin-mbp:~ robince$ python-config --ldflags
-L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -ldl -lpython2....
Apologize because for the moment I don't have the environment to experiment and sort out the following questions myself:
1) Let's say I have four library files: libmylib_super.a and libmylib_super.so, mylib_dumb.a and mylib_dumb.so. While specifying libraries to link to, what are the differences between the following approaches:
A) -l:...
I've been trying to make some applications which all rely on the same library, and dynamic libraries were my first thought: So I began writing the "Library":
/* ThinFS.h */
class FileSystem {
public:
static void create_container(string file_name); //Creates a new container
};
/* ThinFS.cpp */
#include "ThinFS.h"
void FileSystem::...
I've got a pile of code that builds in many places. I just turned on the build on Ubuntu 8.0.4 LTS with gcc 4.2 and ccache, and received for my trouble an error from the linker that I've never seen before. Googling leads to suggestions that I've got a shared object built with naked ld involved, but, in fact, I do not. What do I have?
/u...
I created a simple mono executable using MonoDevelop that prints "hello world". I wanted to try the AOT 'asmonly' option. So:
[root@localhost Debug]# ls
abc.exe
[root@localhost Debug]# mono --aot=full,static,asmonly abc.exe
Mono Ahead of Time compiler - compiling assembly /home/alon/Projects/abc/abc/bin/Debug/abc.exe
Code: 1538 Info: 5...
I have a linux shared library (.so) compiled with a specific version of libc (GLIBC2.4) and I need to use it on a system with different version of libc. I do not have sources for the library in question so I cannot recompile for the new system. Is it somehow possible to change the dependencies in that library to a different libc?
...
I'm now doing some upgrades in my own OS and now I need to use ld, but I don't understand much about how to use it, then I'm asking for a good tutorial for really beginners.
...
I've just organized my code by using headers, but just as I've done this, I got a warning that turned into an error when linking.
I have a code(use of a function that is inside a header) in test.c that is like this:
#include "test1.h"
/* Some code */
main()
{
Testing();
}
And my test1.h header is like this:
void Testing();
void ...
Linux: It there a way to edit a compiled shared library ?
specifically I am searching on how to add the DT_SYMBOLIC flag on an already compiled binary shared library?
Here is why I am asking this:
our application is composed of
our own libraries (static libXXX.a)
some 3rd party libs (binary-only shared libraries libYYY.so)
Every...
There is a software package elfutils which includes a program called eu-elflint for checking ELF binaries (just as lint for C - hence the name).
Just for curiosity I have checked our own shared libraries with this tool and it found a lot of issues, e.g.:
eu-elflint libUtils.so
section [ 2] '.dynsym': _DYNAMIC symbol size 0 does not ma...
the title of this question is an exact dupe, but the answers in that question don't help me.
I have a bunch of object files packed in a static library:
% g++ -std=c++98 -fpic -g -O1 -c -o foo.o foo.cpp
% g++ -std=c++98 -fpic -g -O1 -c -o bar.o bar.cpp
% ar -rc libsome.a foo.o bar.o
I'd like to generate libsome.so from libsome.a inste...
I'm using PocketDOS to emulate ELKS, but I want to develop on it using gcc and ld, how can I do this?
...