linker

What is the most general approach to place a structure into the flash (microcontrollers)

僤鯓⒐⒋嵵緔 提交于 2020-01-04 05:51:08
问题 I am working on an embedded C project using GCC for ARM V-4.8.3 toolchain. I have an array of look-up structures that are read only during the life cycle of the entire program. Since I am running out of RAM (and have plenty of Flash unused) it is better idea to push them into the flash, which will not affect the function of the program. The problem is how. One way to do so is using the variable __attribute__ ((section ("TEXT"))) provided by GCC. In this case my code is compiler dependent. If

final link failed: Invalid argument when including windows.h

為{幸葍}努か 提交于 2020-01-04 04:06:46
问题 I have set up MinGW and Eclipse with CDT for C++ developing on Windows. Everything works great until I #include <windows.h> . As soon as I do that, I get the linker error message c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid argument whereby the path at the beginning resolves to C:/MinGW/mingw32/bin/ld.exe . I have no idea what the error message tries to tell me... so please help me to decrypt it. 回答1: Since I actually don't agree to Lol4t0's

Linking to a DLL with a DEF file instead of a LIB file?

♀尐吖头ヾ 提交于 2020-01-04 02:41:07
问题 I have learned that you can: Convert a .DLL file into a .DEF file, which includes its exports (Edit: This doesn't work with many conventions) Convert a .DEF file into a .LIB file, which you can use to link to the DLL Why can't (most) linkers link to a DLL given only a .DEF file, instead of a .LIB file? 回答1: Ultimately, the answer here is 'because noone wanted it badly enough and it doesn't really help anything'. The DEF file is an input file that creates an import lib for the DLL. And then,

How to get complete linking command instead of just CCLD / How to disable silent rules in make file

跟風遠走 提交于 2020-01-04 01:55:08
问题 I am currently building an app and getting error in linking, here is a command, CCLD Programs/GtkBonker Now I want see the Complete linking Command , Any help is appreciated. PS. I am using GNU Build System with c++ programming language, with Ubuntu 10.04. 回答1: If you want to see full commands or say want to disable silent rules in webkit, There are two ways, you can choose the one which suites your scenario 1).you need to run make command with argument V=1, like this. make V=1 2). pass -

Why does linking against both sdl2 and udev cause a segmentation fault?

别来无恙 提交于 2020-01-04 01:53:11
问题 I have the following really dumb C program: #include <SDL2/SDL.h> int main () { SDL_Init(SDL_INIT_VIDEO); } If I compile it and link against sdl2 , all is well: [nix-shell:~/work/on-the-limit]$ gcc oddity.c -lSDL2 -o oddity [nix-shell:~/work/on-the-limit]$ ./oddity However, if I also link against udev ... [nix-shell:~/work/on-the-limit]$ gcc oddity.c -lSDL2 -ludev -o oddity [nix-shell:~/work/on-the-limit]$ ./oddity Segmentation fault ... a segmentation fault happens. gdb has the following to

GHC Foreign hs_init/hs_add_root crashes

孤街浪徒 提交于 2020-01-03 21:48:09
问题 I don't repeat more than necessary, brief summary: Following the Adder example from this tutorial on a machine with win7 (64) with VS 2010. But I don't use C++ but plain C. When using the cl (MS compiler) with cl /Zi (and no other flag) it works like expected. If not use /Zi and then try to execute the exe goes into flames. Why? (There must be some compiler/link options that make some init in the start of the haskell dll go wrong ) EDIT: Some investigation: /Zi does not affect optimizations.

GHC Foreign hs_init/hs_add_root crashes

廉价感情. 提交于 2020-01-03 21:47:04
问题 I don't repeat more than necessary, brief summary: Following the Adder example from this tutorial on a machine with win7 (64) with VS 2010. But I don't use C++ but plain C. When using the cl (MS compiler) with cl /Zi (and no other flag) it works like expected. If not use /Zi and then try to execute the exe goes into flames. Why? (There must be some compiler/link options that make some init in the start of the haskell dll go wrong ) EDIT: Some investigation: /Zi does not affect optimizations.

program exits without error when linking boost library

二次信任 提交于 2020-01-03 19:08:14
问题 I have a problem with linking boost library into my cross-compiled c++ program. The code I write is cross-compiled with CodeSourcery under Ubuntu 12.04 for an arm-target (Pandaboard, also Ubuntu 12.04). Compiling simple test-programs without library works fine, even OpenCV with static libraries works fine. But here is the problem when linking boost 1.52.0 libraries: When crosscompiled WITH linking boost libraries (-lboost_thread -lboost_system) the program compiles without errors, but when

Question regarding Assembly and computer programs

倾然丶 夕夏残阳落幕 提交于 2020-01-03 18:58:09
问题 I read this article: http://en.wikipedia.org/wiki/Assembly_language It says: Take, for example, the instruction that tells an x86/IA-32 processor to move an immediate 8-bit value into a register. The binary code for this instruction is 10110 followed by a 3-bit identifier for which register to use. The identifier for the AL register is 000, so the following machine code loads the AL register with the data 01100001.[4] 10110000 01100001 It explains how it is easier to write it as: MOV AL, 61h

Undefined reference to libssl function with Android NDK

我是研究僧i 提交于 2020-01-03 17:28:31
问题 I am very new to Android, compiling, and linking in general. I do not know which details are important with my problem, so I will just tell you everything. If you see anything strange or incorrect, please let me know. I built the libcrypto.so and libssl.so libraries in the Android-NDK. I wrote native code which uses a function in openssl.so (and openssl.so uses functions in libssl.so). The code compiles, however I receive an "undefined reference" error when linking: ./obj/local/armeabi/objs