linker

GCC -lm -lz -lrt options - what are they about?

妖精的绣舞 提交于 2020-01-01 07:34:31
问题 I know, that these are some common/basic libraries, but what do they mean exactly? For example, I know, that -lm is some math library, but is this the standard math library or what? -lz for compression? What compression? And I don't have any idea what is this one - -lrt . Can someone specify these things: math library - the same that we use when we include <cmath> or <math.h> ? compress library - what does this mean - provides some tools, that we can use to compress files, or helps the

Unrecognised emulation mode: elf_i386 on MinGW32

二次信任 提交于 2020-01-01 06:53:14
问题 I'm trying to make a kernel, and I cannot link the C output with the assembly. The ld . I'm getting the error: unrecognized emulation mode: elf_i386 I'm using Windows 10 professional with the MinGW32 and MSYS. The code I am using: link.ld /* * link.ld */ OUTPUT_FORMAT(elf32-i386) ENTRY(start) SECTIONS { . = 0x100000; .text : { *(.text) } .data : { *(.data) } .bss : { *(.bss) } } kernel.c /* * kernel.c */ void kmain(void) { const char *str = "my first kernel"; char *vidptr = (char*)0xb8000; /

Unrecognised emulation mode: elf_i386 on MinGW32

删除回忆录丶 提交于 2020-01-01 06:53:08
问题 I'm trying to make a kernel, and I cannot link the C output with the assembly. The ld . I'm getting the error: unrecognized emulation mode: elf_i386 I'm using Windows 10 professional with the MinGW32 and MSYS. The code I am using: link.ld /* * link.ld */ OUTPUT_FORMAT(elf32-i386) ENTRY(start) SECTIONS { . = 0x100000; .text : { *(.text) } .data : { *(.data) } .bss : { *(.bss) } } kernel.c /* * kernel.c */ void kmain(void) { const char *str = "my first kernel"; char *vidptr = (char*)0xb8000; /

CMake linking problem

我怕爱的太早我们不能终老 提交于 2020-01-01 05:21:10
问题 I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(int argc, char* argv[]) { GMainLoop *loop; GstElement *pipeline, *source, *demuxer, *decoder, *conv, *sink; GstBus *bus; /* Initialisation */ gst_init (&argc, &argv); return 0; } This works: g++ -Wall $(pkg-config --cflags --libs gstreamer-0.10) main.cpp -o MPEG4GStreamer How to I make it with CMake? My

C++ Linking Errors: Undefined symbols using a templated class

十年热恋 提交于 2020-01-01 05:21:06
问题 I'm getting some really wierd linking errors from a class I wrote. I am completely unable to find anything that will describe what is happening. Visual Studio (Windows XP) players.obj : error LNK2019: unresolved external symbol "public: __thiscall TreeNode::TreeNode(void)" (??0?$TreeNode@VPlayer@@@@QAE@XZ) referenced in function "public: __thiscall PlayerList::PlayerList(void)" (??0PlayerList@@QAE@XZ) Xcode (OSX 10.5) Undefined symbols: "TreeNode::~TreeNode()", referenced from: PlayerList::

“Undefined reference to” Error while linking object files [duplicate]

不羁岁月 提交于 2020-01-01 05:17:07
问题 This question already has an answer here : “undefined reference to” errors when linking static C library with C++ code (1 answer) Closed 3 years ago . I realize this question has been asked in a number of ways including this very comprehensive answer but I have looked at many and tried fixing my error to no avail. I am using .cpp and .c files to create a program. I compiled all files with g++, it seemed to have no more linking errors, though it gave me a bunch of C++ errors related to the C

Building Visual C++ app that doesn't use CRT functions still references some

孤者浪人 提交于 2020-01-01 05:15:45
问题 This is part of a series of at least two closely related, but distinct questions. I hope I'm doing the right thing by asking them separately. I'm trying to get my Visual C++ 2008 app to work without the C Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API. So I set Project Properties -> Configuration -> C/C++ -> Advanced -> Omit Default Library Names to Yes (compiler flag /Zl ) and rebuilt. Let's pretend I have written a suitable entry point

Hide symbol(s) in Shared Object from LD

99封情书 提交于 2020-01-01 05:05:29
问题 I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my program is built by autoconf/autotools/gcc, conflicting libraries are libclntsh (part of Oracle driver) and OpenLDAP. Unfortuinately, I cannot use Oracle's

What causes iOS linking errors?

百般思念 提交于 2020-01-01 04:02:08
问题 I've been getting some strange linking errors in XCode. I understand more or less what linking errors are, just not why they are showing up in my situation. I have an app that started as iPhone only. When I adjusted it to be universal I got some odd linking errors. I then simply created a new universal project and imported the files, it built and executed without error. Now, working with the iPad interface, I've added some animations and am inheriting QuartzCore/QuartzCore.h but when I build,

C Linking Error: undefined reference to 'main'

心已入冬 提交于 2020-01-01 03:52:06
问题 I have read the other answers on this topic, and unfortunately they have not helped me. I am attempting to link several c programs together, and I am getting an error in response: $ gcc -o runexp.o scd.o data_proc.o -lm -fopenmp /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: ld returned 1 exit status make: * [runexp] Error 1 I have exactly one main function and it is in runexp. The form is int