linker

How to get Flex command-line compc to compile one source path when referenced images are at another directory?

We are having an issue with embedded images when using the compc command-line compiler to generate an .swc for a bunch of library classes. Our directory structure is like this: (some directory structure)/flexprojects/MyLib/src/ (flex packages and classes here) (some other directory structure)/myapp.war/image/ (image files here) Whe...

GCC / Linux: adding a static library to a .so?

I've a program that implements a plugin system by dinamically loading a function from some plugin_name.so (as usual) But in turn I've a static "helper" library (lets call it helper.a) whose functions are used both from the main program and the main function in the plugin. they don't have to inter-operate in any way, they are just helper...

Where do I change the linking command in MSVC++?

Question title says it all, really. Need to add lalleg to the end of my linking command. ...

QT 4.5 - How do I enable LTCG in VS2005 when linking to QT libraries?

While attempting to link with QT 4.5 release, I run into this error message fatal error C1047: The object or library file 'c:\qt\2009.02\qt\lib\qtmain.lib' was created with an older compiler than other objects; rebuild old objects and libraries I have been using the same compiler for my current projects to compile QT 4.5 ...

Using LD to link intermediate files

If I have a.o, b.o, and c.o, how do I make ld link them into d.o, which is then linked into my main object file? All that I want to have happen is that all the symbols in the input files get combined into one big output file. ...

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

hi folks, 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 i...

C++ Yet another linker problem.

Hi all. I'm having a linking issue with a basic C++ program. No, I'm not including .cpp files! This is what's happening. main.cpp #include "header.h" #include <iostream> int main() { std::cout << "Hello!"; } header.h #ifndef _HEADER_H #define _HEADER_H class Something { public: printContents(); }; #endif something.cpp ...

How to prevent the linker from optimizing away startup code?

I have the following problem: My (C++-)project consists of several subprojects. In each, I have several files with code I want to run at startup. My solution so far is to use static variables which call the respective code on initialization like this: // Foo.cpp static TFooRegistry sFooRegistry; // does stuff in constructor. When b...

Unresolved External (abstract class constructor/destructor)

So, I have an abstract class Panel and an implementation of it MyPanel. They look similar to this: class Panel : public QWidget { public: Panel(QWidget* parent = 0) = 0; virtual ~Panel() = 0; // but wait, there's more!! }; class MyPanel : public Panel { public: MyPanel(QWidget* parent = 0); ~MyPanel() {}; // nothing to do her...

Visual C++ 2005 doesn't add /dll argument for linker

What setting(s) in a Visual Studio 2005 project could cause the build to not add the /dll argument to the linker command line? Background: We have a large VC6 project that I'm porting over to VC 2005. This project contains a number of MFC extension DLLs, and I'm running into the following linker warning when I run a build: warning LN...

"unresolved external symbol" for unreferenced function

I'm in Visual Studio 2003. I have a function in a very common module which requires 3 other modules. I want only projects using the new function to have to include the 3 other modules, and those that don't reference the function to link without "unresolved external symbol" errors. I tried function level linking, OPT:REF and every proj...

Mixed language statically linking with gfortran and gcc

Hi, I have some code written in C and Fortran that I want to compile into a statically-linked executable. If I compile the code dynamically (using the -fno-underscoring option for gfortran), it all works fine. However, I want to link it into a .so file, statically linking most of the needed libraries, and then link dynamically to libkrb5...

How to link to a shared library without lib* prefix in a different directory?

I have to link my code to a shared library without the lib prefix. (say, foo.so) The first problem is -l option does not find the file. So I tried directly including this file to the last compilation like this: gcc a a.o /PATH/TO/FOO/foo.so But in this case, a is hard linked to foo.so as an absolute path as seen in "ldd a": /PATH/TO/...

Including boost libraries in make files.

I'm learning Boost and am having trouble with my makes files. Here is my basic makefile: accesstimer: acctime.o btimer.o g++ acctime.o btimer.o -o accesstimer acctime.o: acctime.cpp btimer.h g++ -c acctime.cpp bentimer.o: btimer.cpp btimer.h g++ -c btimer.cpp When acctime.cpp has no boost filesystem elements in it this...

Best approach for simple link within UITextView

I am creating a dictionary lookup application. The user selects a word from a UITableView and the app displays the definition. In some cases the word will be similar to another word, so I want to display "See Also:" followed by a list of similar words that when touched, bring up another definition. In searching here on links within UI...

cannot link boost.system in makefile

Just asked a question about linking Boost libraries in the make file. Thanks to those who helped with that. I ended up with this: accesstimer: acctime.o bentimer.o g++ -L/usr/local/boost/boost_1_39_0/stage/lib -lboost_system -lboost_filesystem acctime.o bentimer.o -o accesstimer acctime.o: acctime.cpp bentimer.h g++ -I /us...

Weird dynamic linking problem on iPhone

The following code crashes in an Xcode created template project. int main(int argc, char *argv[]) { uint64_t t64 = 100000; double s = (double)t64; // Crash! ... The crash is accompanied with the following console output and occurs on a 2.2.1 device but not on 3.0.1 devices. It occurs both compiling for Thumb or ARM. dyld...

Is optimization and generating debug info part of compilation or linkage

I am reading a Makefile from someone else as follows. LDFLAGS=-lm -ljpeg -lpng ifeq ($(DEBUG),yes) OPTIMIZE_FLAG = -ggdb3 -DDEBUG -fno-omit-frame-pointer else OPTIMIZE_FLAG = -ggdb3 -O3 endif CXXFLAGS = -Wall $(OPTIMIZE_FLAG) all: test test: test.o source1.o source2.o $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) M...

GCC: Empty program == 23202 bytes?

test.c: int main() { return 0; } I haven't used any flags (I am a newb to gcc) , just the command: gcc test.c I have used the latest TDM build of GCC on win32. The resulting executable is almost 23KB, way too big for an empty program. How can I reduce the size of the executable? ...

Impact of "Ignore specific library" in Visual Studio

I'm working with an API that is delivered to customers as a static library. This library in turn makes use of another 3rd party library built with the Intel Compiler. This library has dependencies to some Intel libraries that I don't possess. When I build a test application I get past this by specifying these libraries in the "Ignore spe...