Hi,
I would like to trace calls to some 3rd party library which are made from another 3rd party library.
Example: I want to trace calls to library A. My application statically links library B, which in turn is statically linked to library A. So basically what I have is libAB.a
In case of dynamic linking I could write library A2 with ...
in general
we use ar rcs command to create a static library on unix.
what does the flag 's' mean over here
man page says
Do not generate an archive symbol
table. This can speed up building
a large library in several steps.
The resulting archive can not be used
with the linker. In order to build a
symbol table, yo...
// in ClassA.h
static NSString *globalStr = @"HelloWorld";
@interface ClassA
...
@end
// in ClassB.h
#include "ClassA.h"
// in ClassB.m
...
NSLog(@"The global string: %@", globalStr);
...
In C++, "static" should mean the variable or function has a internal linkage.
But it is used to share the variable in this case, e...
While I was reading the accepted answer of this question, I had the following question:
Typically, methods are defined in header files (.hpp or whatever), and implementation in source files (.cpp or whatever).
One of the main reasons it is bad practice to ever include a "source file" (#include <source_file.cpp>) is that its methods imp...
In a c++ project I am working on, I have a simple c++ file that needs to run some code at the beginning of the program execution. This file is linked into a static library, which is then linked into the main program.
I have similar code in other files running fine, that looks something like:
bool ____nonexistent_value = executeAction(...
Hi SOF,
I have this program which uses Boost::Asio for sockets. I pretty much altered some code from the Boost examples. The program compiles and runs just like it should on Windows in VS. However, when I compile the program on Linux and run it, I get a Segmentation fault.
I posted the code here
The command I use to compile it is this...
I want to use a GPL'd library in my C# application, but not necessarily release my own code under the GPL. If I understand correctly linking against a GPL'd library using dynamic linking and not distributing the library in question means I can license my own app in any way I want (the users of my software would then be required to instal...
How can I tell the linker that statically link libfoo.a while building the shared object sharedobj.so using gcc/make.
I have tried to pass the LDFLAG options
LDFLAGS += -W1 --whole-archive -L/path/to/libfoo -lfoo
I have also tried to pass LDFLAGS the options
LDFLAGS += -W1, static -L/path/to/libfoo -lfoo
I have also tried to pass LD...
a linker receives obj's and lib's to create exe's or other libs. But so does a makefile(but it can start from sources on top of that). what is the difference between the two?
...
Let's say we have a some library compiled into .a file. After that this library is linked with other code into some executable file .exe. Size of .a file is 6Mb while this size of .exe file is 3Mb. Obvious explanation of this is that linker has thrower out unused code from the library.
What I want to know is the real library's code footp...
I am new to Objective C and have the following error when trying to import a class defined by me
Building target “MusicCube” of project “MusicCube” with configuration “Debug” — (1 error)
cd /Users/varsha_vijay/Downloads/MusicCube
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Xcode3.1.4/Platforms/iPhoneSimulator.platfo...
i get error of this type:
"in function ... multiple definition of ..."
"... first defined here"
"warning: size of symbol ... changed from to in "
*the code is compiled with the flags: -ansi -Wall -pedantic-errors -Werror
*STL is used
is there any explanation for that?
thank you in advance
...
I want to use some functions from a .cpp source file that has a main function in my .cpp source file. (I'm building with make and gcc.)
Here's the rule from my Makefile:
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) $(LIBS) -o $@
And here's the output (with some names changed to prevent distraction):
$ make foo
g++ -g -Wall -m32 -Ilinux/i...
I'd love help diagnosing the source of a duplicate symbol error that I'm receiving when I try to compile with g++ 4.2.1.
The specific error is
ld: duplicate symbol _SOCIODEM_FILENAMES in /var/folders/c+/c+eq1Qz1Feye7vxs5mQOUE+++TI/-Tmp-//ccP3yVgF.o and /var/folders/c+/c+eq1Qz1Feye7vxs5mQOUE+++TI/-Tmp-//cc1NqtRL.o
collect2: ld return...
In Visual Studio 2008, I have a solution which contains two projects: one project is a .dll, the other is a command line application which calls the .dll.
If I remove one of the files ("ast.c"), then add it straight back in, I get the following error.
How do I fix this error?
Error 22 error LNK2019: unresolved external symbol "__d...
I've just upgraded to XCODE 3.2.3 and upgraded my base sdk from 3.0 to 3.2 iphone sdk. After doing this I started getting a bunch of link errors with barely any info, here's what I got:
".objc_class_name_CATransition", referenced from:
".objc_class_name_NSObject", referenced from:
".objc_class_name_NSFileManager", referenced from:
"....
I have a copy of MS VC++ 6.0 which I do all my development in. I have just received a DLL that has been produced by VC++ 8.0. I need to use some of the functions contained in that DLL in my application. Will I be able to use this DLL in my VC++ 6.0 development environment?
...
I am creating a shared library using c++ -shared (which is gcc running on x86_64). I can't manage to strip my problem down to a minimal test case, but the issue I'm having is that I am creating a .so out of a bunch of .o files. One of those .o files exports a symbol (nm shows 'D') that I want exported from the .so. Others of the .o's req...
As described in http://stackoverflow.com/questions/449827/virtual-functions-and-performance-c virtual methods may have an impact on performance (extra lookup in vtable, no inlining, ...).
But I was wondering, could the use of virtual functions speed up the linking process?
Suppose that I have a class X, calling a method of class Y.
I...
I have a VC++ project in VS2010 that is linking to some dll's built with VS2008. Works fine until I try to pass MFC objects to the VS2008 dll. The artifact of the VS2010 VC++ project (a .dll) is linking against the latest version of MFC that shipped with VS2010, whereas the VS2008 .dll is linking against the previous version of MFC tha...