linker

Suppressing Linking Errors in G++ 3.4.6

Don't ask why, but is there any way to suppress a failed linking error? Such as: undefined reference to BLANK This is in GCC 3.4.6 ...

Linking Libraries in Xcode

Hey all, I'm using a powerbook (osx 10.5) and recently downloaded and installed FFTW 3.2 (link text). I've been able to compile and run some simple programs based on the online tutorial using the terminal: g++ main.cpp -lfftw3 -lm however, I can't get the same program to compile in Xcode. I get a linking error, "symbol(s) not found...

Statically linking to a dynamic library. glibc

So. I have a problem where I have two versions of GCC on a machine. 3.4.6 and 4.1 This is due to some dependency issues with a new piece of software. (requires glibc 4.1) When I go to link this new software with the 4.1 libraries it links fine. However, when it comes to executing the software it can't find the library, because it is...

How to define an object whose address is null?

I am wondering how I can define an object in C whose reference will be null? // definition of foo ... void * bar = &foo; // bar must be null There is some ways I could find to do it, but none fit my needs. __attribute__((weak)) extern int foo; //not working with cygwin/gcc 3.4 __attribute__((at(0))) int foo; //only with rvds #...

Static/Dynamic Runtime Linking

What are the best practices for choosing the linking method in VC++? Can anything/everything be statically linked? On a dynamically linked project, is the relative/absolute location of the linked library important? What are the pros and cons ? added: I was mainly referring to lib files. Do they behave same as dll linking? ...

Why do I get "unresolved external symbol" errors when using templates?

When I write C++ code for a class using templates and split the code between a source (CPP) file and a header (H) file, I get a whole lot of "unresolved external symbol" errors when it comes to linking the final executible, despite the object file being correctly built and included in the linking. What's happening here, and how can I fi...

Indirect linking trouble on OSX

hi everyone. I have some trouble with indirect linking. Here is a small example that shows what's going wrong: $ make g++ -fPIC -Wall -c -o main.o main.cpp g++ -fPIC -Wall -c -o a.o a.cpp g++ -fPIC -Wall -c -o b.o b.cpp g++ -fPic -Wall -r -dynamiclib b.o -o libb.dylib g++ -fPic -Wall -r -dynamiclib a.o -o liba.dylib -L. -lb LD_LIB...

Force static linking of library linked to Xcode target?

My Xcode target links against hdf5 library (using the Link Binary with Libraries build phase). libhdf5 is installed using MacPorts, thus /opt/local/lib contains both the dynamic (.dylib) and static (.a) versions of the library. The text output from the build shows that there is, as expected, a -lhdf5 in the linking step of the build. gc...

Dynamic Link Error

I am observing some behavior for which I am finding it tough to reason. I have a piece of code as follows: int timer_temp_var; if ((timer_temp_var/1000.0) > 5.0) { //Do something } This piece leads to link error. > > dld: warning: Undefined symbol _d_fle" > dld: no output written make[1]: *** > [app.elf] Error 1 But on repla...

PhysX Linker Problem on 64-bit Ubuntu

Hello. I am having a problem getting my project to link with the PhysX libraries on my 64-bit machine. It compiles perfectly fine. I've used the exact same settings as on my 32-bit machine (with the exception of some debugging flags), which links perfectly fine. Here is the build output: g++ -L/usr/lib/PhysX/v2.8.1 -L/usr/lib -o"...

Function pointer incorrect in Visual Studio 2005, code starts at 1 byte offset

...

Compilation & linking of linked LIST ADT

Hellos. Am having a problem with linking my implementation file in Microsoft Visual C++, and getting this error: Compiling... Skipping... (no relevant changes detected) slList.cpp Linking... LINK : fatal error LNK1104: cannot open file ".\Debug\slList.obj" Error executing link.exe. Can somebody please assist? ...

Problem Linking Boost Filesystem Library in Microsoft Visual C++

Hello. I am having trouble getting my project to link to the Boost (version 1.37.0) Filesystem lib file in Microsoft Visual C++ 2008 Express Edition. The Filesystem library is not a header-only library. I have been following the Getting Started on Windows guide posted on the official boost web page. Here are the steps I have taken: ...

When building a DLL file, does the generated LIB file contain the DLL name?

In Visual C++ , when I build a dll , the output files are .dll and .lib. Is the name of the dll built into the .lib file . The reasson I ask this question is : When I built my exe by importing this dll and run the exe , the exe tries to locate the dll to load it in the process address space . As we just specify the library name (.li...

link an Array Controller to an Array in XCode via outlets

hello, I'm trying to find a way to link an array controller to an Array. I know via an outlet I can fill textfields and even tableviews in the .xib file made with Interface Builder. I was hoping it would be possible to have one easy outlet (NSArray) and put it into an Array Controller. In turn, a table will link its contentfield to the...

Using 64 bits integers without C runtime - link error __alldiv

I am trying to build a windows console application without using the C runtime (msvcrt or libcmt). That is to link just against kernel32.lib and use console functions from WIN32 API instead of printf and such. My problem is that during link the compiler fails to find __alldiv which seems to handle 64 bit integer divides in 32 bits appli...

xcode / gcc linking problem: file is not of required architecture

Hi, I am trying to port a windows project that includes boost 1.37 and wxwidgets to the mac. It compiles ok, but the linker gives me a "file is not of required architecture for architecture ppc" error for libz.1.dylib and the same message as a warning a few other libraries. I also get a "duplicate dylib" warning for libz.1.dylib. The ...

Including boost::filesystem produces linking errors

Ok first off, I am linking to boost_system and boost_filesystem. My compiler is a custom build of MinGW with GCC 4.3.2 So when I include: #include "boost/filesystem.hpp" I get linking errors such as: ..\..\libraries\boost\libs\libboost_system.a(error_code.o):error_code.cpp: (.text+0xe35)||undefined reference to `_Unwind_Resume'...

g++: In what order should static and dynamic libraries be linked?

Let's say we got a main executable called "my_app" and it uses several other libraries: 3 libraries are linked statically, and other 3 are linked dynamically. In which order should they be linked against "my_app"? But in which order should these be linked? Let's say we got libSA (as in Static A) which depends on libSB, and libSC which ...

cppunit linking error

When compiling my test suite againts cppunit, I get the following linking error: error LNK2019: unresolved external symbol "public: virtual __thiscall CppUnit::TextTestRunner::~TextTestRunner(void)" (??1TextTestRunner@CppUnit@@UAE@XZ) referenced in function _wmain I don't understand this problem as the provided examples link fine. I...