linker

Xcode 4 and Allegro 5.1 - Linker can't find Framework

我与影子孤独终老i 提交于 2019-12-19 11:36:05
问题 I know there are several other questions here regarding the Linker and Xcode 4, but they don't really relate to my problem. I've built Allegro 5.1 and it took me a while because of FreeType, but eventually it worked. Now I've written a little Space Invader game using Allegro. But somehow the linker can't find the framework. What I've done so far: The Frameworks are located at /Library/Frameworks/ and they have the same structure like all the other frameworks in that place I've added the

ld linker removing an object file from a static library when creating a shared one

☆樱花仙子☆ 提交于 2019-12-19 09:55:58
问题 I have a number of static libraries which I link together into one shared library. One of them, say libUsefulFunc.a contains an object file usefulFunc.o with a function, usefulFunc() that is only used from another static library, let's say usingFunc(), residing in usingFunc.c hosted in libUsingFunc.a The problem is that the linker throws away the usefulFunc.o and I get error " undefined reference ". I tried both orders of linking. I've recreated the situation using the simplest files I could

Clang linker reports “symbol not found”, despite 'nm -m' revealing that the name exists in a library that is being linked against

我只是一个虾纸丫 提交于 2019-12-19 09:27:09
问题 On OS X (clang), during linkage stage, a symbol ( boost::filesystem::portable_posix_name ) in my code is not being found. Here is a brief code snippet that contains the function I am calling in my code: if (boost::filesystem::is_directory(settings.parent_path()) && boost::filesystem::portable_posix_name(settings.filename().string())) { ... } (Please let me know if more context in my code snippet is required.) The linker command line, used when the program compiles and links, contains the

Why can't I compile HelloWorld in C++?

久未见 提交于 2019-12-19 08:44:44
问题 I'm trying to compile a simple Hello World program in C++ but I keep getting the following error...why? gcc -o HelloWorldCompiled HelloWorld.cc /tmp/ccvLW1ei.o: In function `main': HelloWorld.cc:(.text+0xa): undefined reference to `std::cout' HelloWorld.cc:(.text+0xf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/ccvLW1ei.o: In function `__static

Why can't I compile HelloWorld in C++?

眉间皱痕 提交于 2019-12-19 08:44:36
问题 I'm trying to compile a simple Hello World program in C++ but I keep getting the following error...why? gcc -o HelloWorldCompiled HelloWorld.cc /tmp/ccvLW1ei.o: In function `main': HelloWorld.cc:(.text+0xa): undefined reference to `std::cout' HelloWorld.cc:(.text+0xf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/ccvLW1ei.o: In function `__static

What is the difference between _imp and __imp?

拜拜、爱过 提交于 2019-12-19 08:09:45
问题 I came across an interesting error when I was trying to link to an MSVC-compiled library using MinGW while working in Qt Creator. The linker complained of a missing symbol that went like _imp_FunctionName . When I realized That it was due to a missing extern "C", and fixed it, I also ran the MSVC compiler with /FAcs to see what the symbols are. Turns out, it was __imp_FunctionName (which is also the way I've read on MSDN and quite a few guru bloggers' sites). I'm thoroughly confused about how

What is the difference between _imp and __imp?

≡放荡痞女 提交于 2019-12-19 08:09:02
问题 I came across an interesting error when I was trying to link to an MSVC-compiled library using MinGW while working in Qt Creator. The linker complained of a missing symbol that went like _imp_FunctionName . When I realized That it was due to a missing extern "C", and fixed it, I also ran the MSVC compiler with /FAcs to see what the symbols are. Turns out, it was __imp_FunctionName (which is also the way I've read on MSDN and quite a few guru bloggers' sites). I'm thoroughly confused about how

Create an exe file in assembly with NASM on 32-bit Windows

安稳与你 提交于 2019-12-19 07:33:36
问题 I'm making a hello world program in assembly language with NASM on 32-bit Windows 7 . My code is: section .text global main ;must be declared for linker (ld) main: ;tells linker entry point mov edx,len ;message length mov ecx,msg ;message to write mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel mov eax,1 ;system call number (sys_exit) int 0x80 ;call kernel section .data msg db 'Hello, world!', 0xa ;our dear string len equ $ - msg ;length of

Create an exe file in assembly with NASM on 32-bit Windows

孤街浪徒 提交于 2019-12-19 07:33:12
问题 I'm making a hello world program in assembly language with NASM on 32-bit Windows 7 . My code is: section .text global main ;must be declared for linker (ld) main: ;tells linker entry point mov edx,len ;message length mov ecx,msg ;message to write mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel mov eax,1 ;system call number (sys_exit) int 0x80 ;call kernel section .data msg db 'Hello, world!', 0xa ;our dear string len equ $ - msg ;length of

Is there a way to ignore unused undefined references?

不问归期 提交于 2019-12-19 07:24:31
问题 Suppose I have two source files — UndefErr.cpp : #include <cstdio> void UndefFunc(); void Func2(){UndefFunc();} void Func1(){printf("Hi\n");} And the main.cpp : void Func1(); int main(){ Func1(); return 0; } As you see in the UndefErr.cpp the Func2() going to trigger an error, for it using the undefined UndefFunc() . However the main function doesn't care about the Func2() ! According to a relevant question I could pass an option --unresolved-symbols=ignore-in-object-files to the linker, but