linker

How does chroot affect dynamic linking?

我是研究僧i 提交于 2020-01-11 02:34:51
问题 Here's the scenario I'm having: I've created a debootstrap ubuntu maverick (64-bit) environment. I placed it at /env/mav/ on my ubuntu (64-bit) lucid system. I can chroot into /env/mav and can utilize a maverick system perfectly. I can even use the lucid programs fine outside the chrooted environment. That is /env/mav/bin/ls will run. However, I noticed that if I modify LD_LIBRARY_PATH to be /env/mav/lib [1] [2] every single program (both lucid and maverick) I run will crash instantly. (e.g.

Why is my static library so huge?

孤人 提交于 2020-01-11 02:15:29
问题 I have a C++ compiled static library of about 15 classes and their member functions and stuff, and compiled, it's almost 14 megabytes. It links to Google's dense hash table library and MPIR, which is like GMP for Windows, but I did that in a plain exe and it was a few kilobytes. Why is it so massive? What can I do to reduce its size? It seems like there's other programs which are far more complicated than mine that are far smaller. Compiled with Visual C++, command line is: /Zi /nologo /W3

Constants in Objective-C and “duplicate symbol” linker error

孤者浪人 提交于 2020-01-10 23:23:51
问题 I've declared a constant with the same name in some different classes, in their .m file, this way: @implementation MyViewController const NSInteger numberOfItems = 6; ... @end But I get a "duplicate symbol" error when trying to build the project. I've found several posts dealing with this issue regarding extern or global constants, but what I'd want is just declaring some constants private to their class, how can I do that? Thanks 回答1: If you want to use constant only in one .m file then

How to solve error LNK2019

被刻印的时光 ゝ 提交于 2020-01-10 19:42:08
问题 I am sending a simple email in C++. I downloaded a sample C++ program from the below link. http://cboard.cprogramming.com/cplusplus-programming/125655-sending-simple-email-cplusplus.html The sample program seems to hit the following error when it is compiling. Please help me with solution. Error 8 error LNK2019: unresolved external symbol _send_mail referenced in function _wmain Error 9 error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "int __cdecl connect_to

What is the difference between crtbegin.o, crtbeginT.o and crtbeginS.o?

浪尽此生 提交于 2020-01-10 14:57:07
问题 I'm trying to link directly using ld to isolate a build problem. When I include /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so , I get a few issues: ac-aaa.o: In function `__static_initialization_and_destruction_0': /usr/include/c++/4.7/iostream:75: undefined reference to `__dso_handle' ac-callback.o: In function `__static_initialization_and_destruction_0': /usr/include/c++/4.7/iostream:75: undefined reference to `__dso_handle' ... Searching for __dso_handle : $ grep __dso_handle /usr/lib/gcc

Why do we still need a .lib stub file when we've got the actual .dll implementation?

泪湿孤枕 提交于 2020-01-10 00:59:09
问题 i'm wondering why linkers can not do their job simply by consulting the information in the actual .dll files that got the actual implementation code ? i mean why linkers still need .lib files to do implicit linking ? are not the export and relative address tables enough for such linking ? is there anyway by which one can do implicit linking using only the .dll without the .lib stub/proxy files ? i thought the windows executable loader would simply do LoadLibrary/LoadLibraryEx calls on behalf

Install and use QWT under Mac OS X

三世轮回 提交于 2020-01-09 10:55:46
问题 I am currently trying to get QWT 6.1.0 running under MAC OS X 10.7.5. I followed the instructions over here --> http://qwt.sourceforge.net/qwtinstall.html I didn't changed something inside the configuration files. So everything worked fine, but now I want to use the qwt-libary inside my own Project. I added the following line to my .pro INCLUDEPATH += /Users/userX/Downloads/qwt-6.1.0/src So my Project is now able to find all the header Files. But I also have to link against the libary. But I

Linking archives (.a) into shared object (.so)

本小妞迷上赌 提交于 2020-01-09 08:57:11
问题 I'm compiling some shared objects file into an archive.a : $ g++ -c -Iinclude/ -fPIC -O0 -o object1.o source1.cpp $ g++ -c -Iinclude/ -fPIC -O0 -o object2.o source2.cpp $ ar rvs archive.a object1.o object2.o r - object1.o r - object2.o So far so good. The resulting archive.a has a good size of some KB. A dump with nm shows that the corresponding object-files are contained within the files. Now I'm wanting to compile several of these archives into a shared object file. g++ -g -O0 -Iinclude/ -I

Finding address of variable in shared library

孤街醉人 提交于 2020-01-07 19:36:54
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it

Finding address of variable in shared library

冷暖自知 提交于 2020-01-07 19:36:22
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it