linker

What's the use of .map files the linker produces?

What is the use of .map files VC++ linker produces when /MAP parameter or "Generate map file" project setting is used? When do I need them and how do I benefit from them? ...

Why doesn't Xcode recognize my LIBRARY_SEARCH_PATHS?

I've set LIBRARY_SEARCH_PATHS to /opt/local/lib, and verified that the library in question is there (I'm linking to GLEW): $ls /opt/local/lib libGLEW.1.5.1.dylib libfreetype.a libz.a libGLEW.1.5.dylib libfreetype.dylib libz.dylib libGLEW.a libfreetype.la pkgconfig libGLEW.dylib libz.1.2.3.dylib libfreetype.6.dylib libz.1.dyli...

Microchip Linker problem

hello guys,when i was trying to build my project in MPLAB,i got this Build error message.. Clean: Deleting intermediary and output files. Clean: Deleted file "M:\12 CCP PWM\12 CCP PWM.o". Clean: Done. Executing: "C:\MCC18\bin\mcc18.exe" -p=18F46K20 "12 CCP PWM.c" -fo="12 CCP PWM.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- MPLAB C18 v3.20...

Linking libsox in Windows

Hello, can anyone help me with linking libsox to my program in Windows? I have made a static library libsox.lib according to directions in INSTALL file in sox 14.2.0 source code version. Is there any way to build a dynamic library? I think it should be easier way... ...

C++ / Eclipse undefined reference question

I'm having trouble with what is apparently a linker error ("undefined reference") in Eclipse / C++. All the classes shown below compile fine, except for one, PlayGame.cpp, which is giving the "undefined reference" error (also shown below). Below are the relevant classes and pieces of code. PlayerFactory.h PlayerFactory.cpp Game.h ...

propagation of "-g" in shared libraries with gcc

I have the a program abc. abc uses the library def and def in turn includes a library ghi. Now, libghi.so is compiled and linked using gcc -g. libdef.so is also compiled and linked using gcc -g. However, abc isn't linked with -g. The question is, if I debug abc with gdb should I be able to see the symbols in def and ghi? The projec...

Problem linking when using stl in VS2005

I just added STL usage to some code, and I'm getting this link error: error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" I must be missing something in the link, I've done this before - and googling has not helped so far. hmm...... Here's the code snippet: #pragma once #include "Observer.h" #i...

Any good current cross-platform reference for UNIX compiler/linker options?

I have used this summary reference for years but it is beginning to show its age. If you have any you might suggest as more current I would greatly appreciate it. ...

ld can't find c file

I have a assembly file and a c file compiled to .o files (start.o and main.o) and is trying to link them with ld. I'm using this command: ld -T link.ld -o kernel.bin start.o main.o where link.ld is a linker script, but when I run it, i get this error: start.o:start.o:(.text+0x2d): undefined reference to `_main' in the assembly file...

linking *.o files in Windows

When I'm linking .o files with the LD linker using MinGW on Windows, it gives me the error "file.o: File not recognized: file format not recognized". I've tried to do it with cygwin instread, but the same thing happens. Any suggestions? ...

Any way to change linking to avoid the LD_PRELOAD on HPUX?

I think I understand why I need LD_PRELOAD set when loading a multithreaded applicatoin that loads a single threaded library that loads libcl.2 but I was wondering if I could use some linker setting to avoid this. Any help appreciated. Update: Perl loads dynamic /usr/lib/libc.2 Perl loads DB2.sl DB2 Attempts to loa...

C++ ODBC problem with sqlucode.h header

I found a great C++/ODBC example here... The project I downloaded builds great and everything works. However, when I copy the .cpp and .h files into another project, I seem to have a linking problem. The SQLConnect function in sql.h is the one I want. When I right-click this function in the easyodbc.h file in the project I downloaded...

Trying to no-op an instruction

Is it possible using GNU tools (gcc, binutils, etc) to modify all occurrences of an assembly instruction into a no-op? Specifically, gcc with the -pg option generates the following assembly (ARM): 0x0: e1a0c00d mov ip, sp 0x4: e92dd800 stmdb sp!, {fp, ip, lr, pc} 0x8: e24cb004 sub fp, ip, #4 ; 0x4 0xc: ebfffffe bl 0 <mco...

Undefined Symbol: _sf_open (Simple audio stuff on OSX)

I'm trying to get into C++ programming, and I'm quite struggling against the little details. Right now, I'm trying to get the snippet below to work, and apparently it will compile, but not link. (error message is a the bottom of this post) I'm using libsndfile to open audio files, and the linker doesn't seem to find the corrent library ...

GNU linker: alternative to --version-script to list exported symbols at the command line ?

On Linux with the GNU toolchain, I know how to control exported symbols from a shared library with a version script (gcc -Wl,--version-script=symbols.map), but I would like to list exported symbols on the command line instead. IOW, I would like the equivalent of link /EXPORT:foo from the MS toolchain. Is it possible ? EDIT: My quest...

Boost linkage error in Eclipse

I've been banging my head fruitlessly against the wall attempting to include boost's thread functionality in my Eclipse C++ project on Ubuntu. Steps so far: Download boost from boost.org ./configure --with-libraries=system,thread make sudo make install sudo ldconfig -v In the eclipse project, set the include directory to: /usr/loc...

legacy linker (uses libc5) fails on linux kernel 2.6.25

We have a legacy linker that uses libc5, and due to several factors we only have the binary and not the source. Yes, version control would have saved us from our current problem... that is now in use for our full tool chain and product line, but this particular horse is long gone. This linker works on linux kernel 2.6.24, but on 2.6.25 ...

ld linker question: the --whole-archive option

The only real use of the --whole-archive linker option that I have seen is in creating shared libraries from static ones. Recently I came across Makefile(s) which always use this option when linking with in house static libraries. This of course causes the executables to unnecessarily pull in unreferenced object code. My reaction to this...

Prevent linker from removing globals

I am using static global variables constructors as a trick to conveniently register functions, the idea goes something like this: typedef int (*FuncPtr)(int); struct RegHelper { RegHelper(const char * Name, FuncPtr Func) { Register(Name, Func); } } #define REGISTER(func) RegHelper gRegHelper_ ## func (#func, func); ...

How do I compile assembly routines for use with a C program (GNU assembler)?

Hello! I have a set of assembly function which I want to use in C programs by creating a header file. For instance, if I have asm_functions.s which defines the actual assembly routines and asm_functions.h which has prototypes for the functions as well as some standard #define's I needed. My goal is to use a C program, say test_asm.c to ...