I have declared an external function with a GCC weak attribute in a .c file:
extern int weakFunction( ) __attribute__ ((weak));
Compiled object file has weakFunction defined as a weak symbol.
Output of nm:
1791: w weakFunction
I am calling the weak defined function as follows:
if (weakFunction != NULL)
{
weakFunction()...
I have a question which may be somewhat silly because I'm pretty sure I may know the answer already.
Suppose you have static library A, and dynamic shared object library B and your program C under linux. Suppose that library A calls functions from library B and your program calls functions from library A. Now suppose that all functions ...
I'm having a binary static library libfoo.a compiled for 32 bit linux machine. I wish to compile it against my win32 project compiled with cygwin.
Is that possible? It seems to be possible, as all the object files in the archive should be in the standard ELF format.
However I keep recieving linking errors about functions that nm finds ...
I thought one of the best ways to familiarise myself with C/C++, is to make a helpful library. I was maybe thinking like a geometry library, like to calculate areas, surface area, etc. It would be useful in game programming. Or maybe an algebra library, like for different formulas like the distance formula, quadratic formula, etc. Or may...
What is the difference??? I use Eclipse and there are several project types including Static Libraries and Shared Libraries? Does one have an advantage over the other?
...
I have a static library project in Eclipse that was compiled into a .a file. So now how would I use the functions and constants in that library? Would I just put in into my includes:
#include "mylib.a"
...
I'm trying to reuse a group of Obj-C clases between iPhone applications. The values that differ from app to app have been isolated and I'm trying to figure out the best way to apply these custom values to the classes on an app-to-app basis.
Should I hold them in code?
// I might have 10 customizable values for each class, that's a lon...
I currently have a console project which creates an .exe file; I want it to also create a .lib file so other projects, compiled as DLLs, would be able to call functions from the original project.
I know it is possible, but I couldn't find how to do that. How do I tell the linker to also link a .lib?
...
Hello guys,
I've followed this tutorial for setting up a static library with common classes from 3 projects we are working on.
It's pretty simple, create a new static library project on xcode, add the code there, a change some headers role from project to public. The tutorial says I should add my library folder to the header search pat...
I have a project tree in Xcode that looks like this: AppProject depends on ObjcWrapper which in turn depends on PureCppLib. ObjcWrapper and PureCppLib are static library projects. Combined, all sources barely reach 15k lines of code, and, as expected, the size of resulting binary is about 750Kb in release mode and slightly over 1Mb in de...
I'm developing a static library in Obj-C for a CocoaTouch project. I've added unit testing to my Xcode project by using the built in OCUnit framework. I can run tests successfully upon building the project and everything looks good. However I'm a little confused about something.
Part of what the static library does is to connect to a UR...
Hi!
I have a static library static_library.a
How to list functions and methods realized there.
or at least how to look is there concrete function 'FUNCTION_NAME' realized?
...
Hi all,
A project that I've inherited has the following structure:
Project A produces a static library.
Project B produces a static library and links with library A.
Project C produces the executable and links with library B.
When I run app in debug mode, I can successfully debug code within the executable (project C) and the static...
I have some C++ code that I want to make into a static lib for use with Java on the Android platform. Can anyone point me to a resource that tells me how to do this? I am completely new to Java and Android.
...
I have a singleton class, and I will compile it as a library static(lib) or dynamic(dll).
Is it guaranteed that calls to same file in a machine always refer to same and unique instance in both cases?
Edit:
What if a process loads two different library and different functions from these libraries want to use instance of singleton class....
Hello,
I want to build a static library (*.LIB file) GNU libiconv on windows to be used with other libraries in Visual C++. Other libraries I'm using are built with "MultiThreaded DLL" (/MD) Runtime option. So, I need to build libiconv with the same option.
Problem is the libiconv uses GNU build system and I want to compile with /MD op...
Hi folks:
I have a question: How to compile a static library in linux with gcc, i.e. I need to compile my source code into a file named out.a. Is it sufficient to simply compile with the command gcc -o out.a out.c? I'm not quite familiar with gcc, hope anyone can give me a hand. Thanks
Regards.
...
I'm porting an existing system from Windows to Linux. The build is structured with multiple static libraries. I ran into a linking error where a symbol (defined in libA) could not be found in an object from libB. The linker line looked like
g++ test_obj.o -lA -lB -o test
The problem of course being that by the time the linker finds it ...
How do you specify, in Visual Studio 2010, the order in which library files should be linked?
I have a project that links against libexpat and against another library. This library (not under my control) seems to also include libexpat. The problem is that 'we' use a different version of the library (XML_UNICODE vs not). In Visual Studio...
I know this question has been posed several times, but my goal is slightly different with regard to what I have found searching the web. Specifically, I am already able to build a static library for iPhone, but the final fat file I am able to build only contains arm and i386 architectures (and I am not sure to what arm refers: is v6 or v...