linker

How do I create both a .lib file and an .exe file in Visual C++?

I currently have a console project which creates an .exe file; I want it to also create a .lib file so other projects, compiled as DLLs, would be able to call functions from the original project. I know it is possible, but I couldn't find how to do that. How do I tell the linker to also link a .lib? ...

What am I doing wrong?, linking in C++

I'm trying to code a simple base64 encoder/decoder (to test my programming skill). I can compile it, but it doesn't link, I've this message error: C:\Documents and Settings\Facon\Escritorio>g++ base64.o main.o -o prueba.exe main.o:main.cpp:(.text+0x24a): undefined reference to `Base64Encode(std::vector > const&)' collect2:...

what does this error mean in c?

#include<stdio.h> #include<ctype.h> int main() { char a,b; FILE *fp; fp=fopen("lext.txt","w"); fprintf(fp,"PLUS"); return 0; } the error i get is this /tmp/ccQyyhxo.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status ...

More GCC link time issues: undefined reference to main

Hi Guys, I'm writing software for a Cortex-A8 processor and I have to write some ARM assembly code to access specific registers. I'm making use of the gnu compilers and related tool chains, these tools are installed on the processor board(Freescale i.MX515) with Ubuntu. I make a connection to it from my host PC(Windows) using WinS...

Exposing headers on iPhone static library

Hello guys, I've followed this tutorial for setting up a static library with common classes from 3 projects we are working on. It's pretty simple, create a new static library project on xcode, add the code there, a change some headers role from project to public. The tutorial says I should add my library folder to the header search pat...

Getting error while linking with g++

Hi all, I try to compile and link my application in 2 steps : Compiling: g++ -c -o file1.o file1.cc general_header.h g++ -c -o file2.o file2.cc general_header.h g++ -c -o file3.o file3.cc general_header.h Linking: g++ -o myApp file1.o file2.o file3.o I'm getting a link error as following: file1.o: file not recog...

Visual Studio 2010 Linker Finding Multiply Defined Symbols (Where It Shouldn't)

I've just started with C++, and maybe there's something that I'm doing wrong here, but I'm at a loss. When I try to build the solution, I get 4 LNK2005 errors like this one: error LNK2005: "public: double __thiscall Point::GetX(void)const " (?GetX@Point@@QBENXZ) already defined in CppSandbox.obj (there's one for each get/set method, an...

GNU ld removes section

I'm writing a boot script for an ARM-Cortex M3 based device. If I compile the assembler boot script and the C application code and then combine the object files and transfer them to my device everything works. However, if I use ar to create an archive (libboot.a) and combine that archive with the C application there is a problem: I've ...

AIX xlC cross-compilation/linkage for C++ not finding C symbols

I am attempting to cross-compile on AIX with the xlc/xlC compilers. The code compiles successfully when it uses the default settings on another machine. The code actually successfully compiles with the cross-compilation, but the problem comes from the linker. This is the command which links the objects together: $(CHILD_OS)/usr/vacpp/b...

VS2010 final does only link project on "rebuild all", not on "build changed"

I've just migrated a solution containing c++ and c# projects from VS2008 to VS2010 and got a strange problem. When I select "rebuild all", everything compiles and links as I would expect it to do. Then I change some c++ source file (just add a space), build the project, I get several thousands of linking errors like these: GDlgPackerL...

Visual Studio: Link executable

Lets say I have: a static library project called "LIB" a application project called "LIBAPP" a application project called "APP" a application project called "APPTEST" When i add "LIB" to LIBAPP Project Dependencies, Visual Studio automatically links "LIBAPP" against LIB. But when i add APP to APPTEST Project Dependencies, it doesnt....

Make LLVM inline a function from a library

I am trying to make LLVM inline a function from a library. I have LLVM bitcode files (manually generated) that I linked together with llvm-link, I also have a library (written in C) compiled into bitcode by clang and archived with llvm-ar. I manage to link everything together and to execute but i can't manage to get LLVM to inline a func...

How to open a .a file

I've a little problem: I have to open a linker file, that have .a extension. I use Dev-C++, I don't know if it would be useful for you :-P I hope you will answer soon! Oh, and excuse me for my bad English, tell me if I made some mistakes! Thanks!! Ale ...

Unresolved External Symbol linker error (C++)

Hi, I am trying to develop abstract design pattern code for one of my project as below.. But, I am not able to compile the code ..giving some compile errors(like "unresolved external symbol "public: virtual void __thiscall Xsecs::draw_lines(double,double)" (?draw_lines@Xsecs@@UAEXNN@Z)" ).. Can any one please help me out in this... #i...

Size of static libraries generated by Xcode

I have a project tree in Xcode that looks like this: AppProject depends on ObjcWrapper which in turn depends on PureCppLib. ObjcWrapper and PureCppLib are static library projects. Combined, all sources barely reach 15k lines of code, and, as expected, the size of resulting binary is about 750Kb in release mode and slightly over 1Mb in de...

g++ not linking header files properly

I am using cygwin libraries to run C and C++ programs on Windows. gcc runs fine, but with g++, I get a long list of errors. I think these erros are because of linking problems with C libraries. Can you suggest what I need to do to fix this? beginning error lines: In file included from testgpp.cpp:1: /cygdrive/c/cygwin/bin/../lib/gc...

crt0.o and crt1.o -- What's the difference?

Hello, recently I've been trying to debug some low level work and I could not find the crt0.S for the compiler(avr-gcc) but I did find a crt1.S (and the same with the corresponding .o files) What is the difference between these two files? Is crt1 something completely different or what? They both seem to have to do with something for boo...

"Relative to Current SDK" doesn't work mixing Mac Framework and iPhone static library

I have a framework of code I maintain. It's got mac and iphone objective-c code. And some of it is shared. I'm not having any problems with code. It's a problem with Xcode. Let's just call my framework "AwesomeKit" for this problem. The first thing I did was create an xcode Framework project called "AwesomeKit". Add source files to it,...

Beginner problem / error with ansi-c and gcc under ubuntu.

Hi, I am just starting programming ansi c with gcc under ubuntu (9.04). I get following error messages: error messages: main.c:6: error: expected identifier or ‘(’ before ‘/’ token In file included from /usr/include/stdio.h:75, from main.c:9: /usr/include/libio.h:332: error: expected specifier-qualifier-list before ...

Problem in linking an nasm code

I'm using a computer with an Intel Core 2 CPU and 2GB of RAM. The SO is Ubuntu 9.04. When I try to compile this code: ;programma per la simulazione di un terminale su PC, ottenuto utilizzando l'8250 ;in condizione di loopback , cioè Tx=Rx section .code64 section .data TXDATA EQU 03F8H ;TRASMETTITORE RXDATA EQU 03F8H ;RICEVITORE...