linker

"/usr/bin/ld: cannot find -lz"

I am trying to compile android source code under ubuntu 10.04. I get the following error saying "/usr/bin/ld: cannot find -lz". Can you please tell me how can I fix it? what does "can't find -lz" mean? external/qemu/Makefile.android:1101: warning: overriding commands for target `external/qemu/android/avd/hw-config-defs.h' external/qemu...

gcc Linkage option -L: Alternative ways how to specify the path to the dynamic library

If I compile my source code with "-L." the dynamic library libmd5.so can be found. gcc main.c -g -O2 -Wall -o main -L. -lmd5 -lcr But if I leave the "-L."-option away, the linker does not find the dynamic library. How can I change that without having to invoke "-L."? (additional info libmd5.so and libmd5.so.1.0.1 are located in /hom...

Experts - GCC and ld linker : re-initialization of variables contained in .data section?

In an C program, I need to re-initialize all global variables as they where when the program starts for tests purpose. I want to reproduce the data copy from Load Memory Address, LMA to VMA (run-time address) done by GCC libraries with a reinitialization function. For example, if foo variables are declared as global and initialized. And...

How can my XCode project files be exactly the same as a working project and still have build errors?

I'm following a tutorial from chapter 12 of the book "Beginning iPhone 3 Development." When I try to build the project I get an error. The book came with the project files, so I went through every file in my Classes directory and copied and pasted the code from the example project so that they are identical. This has solved my build erro...

XCode Cocoa Console Application Linking Error

Hey guys, I made a new project in XCode (console application). Then I added a new Objective-C class and compiled it. However, it wouldn't build. Here are the errors I am seeing: Undefined symbols: "_objc_msgSendSuper", referenced from: -[Terminal init] in Terminal.o -[Terminal dealloc] in Terminal.o ".objc_class_name_NS...

How to find a library with cmake?

To link an executable with a library that resides in a standard location, one can do the following in a CmakeLists.txt file: create_executable(generate_mesh generate_mesh.cpp) target_link_libraries(generate_mesh OpenMeshCore) This would work if the library, that is being linked against, was placed in /usr/local/lib/libOpenMeshCore.d...

Porting NewLib: crt0

I am porting NewLib for my own OS by following a tutorial. It says that once I finished my crt0, I have to "link it as the first object". How can I do that? ...

Error compiling Qualnet on Mac: file is not of required architecture

When trying to compile Qualnet on Mac, I got the following error: ld: warning: in ../kernel/obj/mobility_private.o-darwin-x86-gcc-4.0, file is not of required architecture and a bunch of errors for other files in this kind. So I'm wondering if there is anyway to solve the problem. Anxious waiting for help. ...

How can I resolve LNK4254 warnings in link.exe?

I'm trying to compile an open-source project. One of the steps involves running a .mak file which has the following line: kbddvp32.dll: kbddvp32.obj kbddvp.res $(LINK32) -nologo -dll -base:0x5FFF0000 -subsystem:native -def:kbddvp.def -noentry \ -merge:.edata=.data -merge:.rdata=.data -merge:.text=.data -merge:.bss=...

CUThread lnk2001 error

1>Linking... 1>main.cu.obj : error LNK2001: unresolved external symbol cutWaitForThreads 1>main.cu.obj : error LNK2001: unresolved external symbol cutStartThread I get those errors when trying to compile my project. I have included the cutil64 in linker dependencies, but I can see that's not it. I can't seem to figure out what's wrong w...

Splitting an ELF executable into two files in an embedded system

Hi, I use Xilinx Microblaze CPU core in Virtex4 FPGA. I would like to add a new code part to my current code, but then my code will exceed the size of the flash it is burnt to. Therefore I want to burn the added code to another flash. My code is copied to RAM by a boot loader, which then jumps to RAM and starts regular execution. I int...

error LNK2019 unexplainable when trying to port openldap to windows

Hi , I m working on windows XP with visual studio 2005. My project is a Cmake project created after creating an LDAP abstraction API on linux.I m trying somehow to make it work on windows. I've got an unusual linking error of type LNK2019 code : main.obj : error LNK2019: symbole externe non résolu _strcpy référencé dans la fonction _m...

How to ignore undefined symbols at runtime in Linux?

I know that by default undefined symbols are ignored at compile time. However, I would also like them to be ignored at run-time. I need to distribute a .so that will run with and without MPI. I will know ahead of time if it is an MPI job and if it is not I won't make any MPI_* calls. If it's not an MPI run I need the application to not c...

Linking the Windows API

Hello, I was using a ITK library. When I wrote a sample program using this library, I've got following linker errors. As we can see these all "unresolved" symbols are Windows API functions and these windows API functions were used by ITK library and not my program. Error 1 error LNK2019: unresolved external symbol _SnmpUtilVarBind...

CMake croscompile problem with CXX_FLAGS in linker

I have following toolchain for iPhone crosscompilation on mac os x: # Platform Info SET (CMAKE_SYSTEM_VERSION 1) SET (CMAKE_SYSTEM_PROCESSOR arm) # SDK Info SET (SDKVER "3.0") SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer") SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk") SET (CMAKE_OSX_SYSROOT "${SDKROOT}") SET (...

Linking Errors While creating a shared library

Hello, I currently have some C++ code that I want to compile into a shared library that I can dynamically link to a Java application during runtime using the Java Native Interface (JNI). The problem that I'm facing is - the C++ code that I'm trying to compile calls on another library itself, making use of a lot of classes and different h...

How to optionally depend on a shared object with gcc?

First, I don't know if there is a solution to my problem at all. I have the following situation: I have developed a framework library that depends on several other libraries for specific hardware access, etc. Until now this framework library was only statically linked against. For the executable that uses the framework library only th...

Statically linking new libc symbols to use with a lower libc version

I have an app that uses eventfd and timerfd kernel syscalls. For that use you need a modern kernel and a libc that supports them, at least 2.8. My current situation is, I have a system with the proper kernel but a 2.7.11 libc version which obviously does not support the required functions for the new syscalls. But, as those 2 interfaces...

Link my shared library to another (CMAKE)

Hello, I'm currently trying to link a CXX library that I've written to a VTK, a CMake made library - to end up creating a shared library that has my code's functionality and can resolve the symbols from VTK. I need the end result to be shared because I'd need to call the library up at runtime in Java. Please feel free to ask any quest...

Link Errors when building for Device for Iphone

Hi i've been struggling with these errors for a day now. I'm using the TouchJSON framework(http://code.google.com/p/touchcode/) for the iphone.Everything compiles fine on the iphone simulator but when i try to compile on the device i get link errors. Undefined symbols: "___switch8", referenced from: -[NetworkController constructByte...