FAQ Database Discussion Community


error LNK2001 __imp_fprintf Visual Studio 2015 RC

c++,visual-studio,linker,sdl,visual-studio-2015
I recently was forced to upgrade from Visual Studio 2015 Pre-Release to Visual Studio 2015 Release Candidate as a result of an expired license. My project was previously building fine, however, now it is not. I am getting only two link errors and I've spent the last two days attempting...

Undefined symbols after crashlytics update

xcode,compilation,linker,crashlytics
I have a problem after update of crashlytics framework in my project, through fabric app of course, it is linker error precisily, log below. Ld /Users/losiennik/Library/Developer/Xcode/DerivedData/InternalApp-cujowfodrnucvoglpkjjfmshsvrs/Build/Products/Debug-iphonesimulator/InternalApp.app/InternalApp normal x86_64 cd /Users/losiennik/temp/InternalApp-ios-fork_DONOTREMOVE export IPHONEOS_DEPLOYMENT_TARGET=7.0 export...

Linker error when operator== is a friend [duplicate]

c++,templates,linker,friend
This question already has an answer here: overloading friend operator<< for template class 5 answers The following code is a minimum code to reproduce my problem. When I try to compile it, the linker can not find operator== for Config: Undefined symbols for architecture x86_64: "operator==(Config<2> const&, Config<2> const&)",...

Embox compilation and flashing

c,linker,operating-system,real-time
I am interested in attempting to compile, package and flash Embox to an MCU, from either a Windows or Mac machine (cross-compilation), via JTAG, and I have a number of concerns. Observe what I believe to be the normal way of writing Embox apps and deploying/flashing them to an MCU:...

'The command line is too long' when linking .obj files in Windows command prompt

windows,maven,dll,cmd,linker
As a last step to my maven build on Windows, it tries to create a dll file by linking around 1500 object files. Looks something like this: cl.exe foo.dll (around 1500 .obj files) (couple of other statically linked libraries) The build fails with just one statement: The command line is...

Should GHC be linking different versions of the same libraries?

haskell,linker,ghc
I'm trying to compile a program with GHC 7.6.3 and I get the error /usr/lib/ghc/unix-2.6.0.1/libHSunix-2.6.0.1.a(execvpe.o): In function `pPrPr_disableITimers': (.text+0x300): multiple definition of `pPrPr_disableITimers' /home/tom/.cabal/lib/i386-linux-ghc-7.6.3/unix-2.7.1.0/libHSunix-2.7.1.0.a(ghcrts.o):ghcrts.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status (The problem ultimately derives from a usage of readProcessWithExitCode but I don't think that's especially relevant)...

declaration/initialization issue with multiple files in C++

c++,compilation,linker,header-files
I know how to call a simple function (i.e. add(int x, int y){return x+y;} and nothing more) from a second .cpp file. Now I wanted to go one step further and get following problem: in my main.cpp I got one line like this (important part is the variable a_wt at...

How does gcc's linktime optimisation (-flto flag) work

performance,gcc,optimization,linker
I understand more or less the idea: When compiling separate modules and producing assembly codes, functions calling each-others have to respect strictly the calling convention, which kills the opportunity for many optimisations when compiling separate modules. For instance if I have function A which calls function B which call function...

VS2012 Identifer not found when part of static lib

c,visual-studio-2012,linker,static-libraries
Using VS2012 C/C++: I created and linked a static lib called "libtools" to my project. Calls to functions in the libtools lib worked as expected. I created and linked a second static lib called "shunt" to my project. But when I incorporate a call to a function in shunt, I...

CMake does not find OpenCV libraries

c++,opencv,linker,cmake,make
Similarly to this question, I have troubles using OpenCV and CMake on OS X 10.10.3. After much hassle, I finally managed to build the OpenCV 3.0 beta on my system; the headers now reside in /usr/local/include and the libs – as they should – are in /usr/local/lib. I have small...

Is binary linked with gold linker running faster?

c++,ubuntu,linker,ld,gold-linker
Running simulation code using GEANT4 (large Monte Carlo C++ simulation framework, lots of shared libraries). Compiled and linked GEANT and my app with gold linker and with standard BFD based linker. Looks like gold one is running a bit faster (1'47" vs 1'51"). Could someone shed a light what would...

Program which behavior changes depending on classes it is linked against

c++,plugins,linker,extern
I do not think what I attempt is fancy enough to deserve the term "plugin" but here what I am trying to do: Given files a.h, a.cpp and main.cpp, I would like to create other files such as: g++ -o test main.cpp a.cpp b.cpp results in a test program doing...

MPIR gcc compilation - cannot find -lmpir

c++,c,compilation,linker,mpir
I am trying to compile a simple C program using GCC with MPIR under MinGW on my Windows 7 machine. I installed MPIR successfully (I guess) with configure, make, make check and make install (did not use "sudo" - what is this?). The program is called "mytest.cpp", sits in the...

How does using -L affect the linker?

linux,ubuntu,gcc,linker,ld
I'm rather new on Linux, so maybe this is a simple question. The question is: How does adding a -L/path affect the linker when there are no libraries attached? my issue: I'm trying to set up a cross-compilation toolchain featuring two pieces of third-party libraries¹. I'm using the linaro arm-linux-gnueabihf-raspbian...

Program with Protocol Buffer can't get linked

c++,compilation,linker,activemq,protocol-buffers
I have a cpp file in which I am trying to use the message that I created with protocol buffer. However I keep getting that famous "undefined reference" error as follows: undefined reference to PointMsg::PointMsg() undefined reference to PointMsg::~PointMsg() undefined reference to PointMsg::~PointMsg() Here is the proto file that I...

Link static library with static library

c,linker,autotools,automake
I have a Makefile.am with two noinst_LIBRARIES, and one of them needs to link with the other. Adding it to the CFLAGS throws a compiler warning, but as far as I know, automake likes to freak out about using LDADD with libraries, since they are not complete programs. How can...

How to insert data into compiled binary for MCU

c,linker,microcontroller,ld,linker-scripts
I am trying to insert a md5 hash of part of my binary into the binary, for keeping track of MCU FW version. I have approached it like this: in the link script I have split the flash in two sections MEMORY { FLASH0 (rx) : ORIGIN = 0x8000000, LENGTH...

Linker error (LNK2019) for two classes located in a single file

c++,linker
I have two classes located in ExtractMaximalStableRegion.h. They are class ExtractM_StableRegion { public: //! the full constructor ExtractM_StableRegion(int _delta = 5, int _min_area = 60, int _max_area = 14400, double _max_variation = 0.25, double _min_diversity = .2, int _max_evolution = 200, double _area_threshold = 1.01, double _min_margin = 0.003, int...

Boost unit test link error — abi mismatch?

c++,unit-testing,boost,linker,abi
I'm trying to build a unit test with boost, but the linker complains about a missing function. Take this skeleton code #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(TestFuncOps); BOOST_AUTO_TEST_CASE(CopyConstructor) { } BOOST_AUTO_TEST_SUITE_END(); But it fails with Undefined symbols for architecture x86_64: "boost::unit_test::ut_detail::normalize_test_case_name[abi:cxx11](boost::unit_test::basic_cstring<char const>)", referenced from:...

gcc fails with “undefined reference” in Cygwin, but the reference exists in a linked library

c,gcc,linker
I've built and installed libmarpa in Cygwin with the end result being in /usr/local/lib/libmarpa.a. I have a simple file: #include "libmarpa/dist/marpa.h" int main() { return marpa_check_version(8, 3, 0); } But the linker fails to find marpa_check_version: $ gcc test.cc -L/usr/local/lib -lmarpa /tmp/ccdYM1vV.o:test.cc:(.text+0x1e): undefined reference to `marpa_check_version(int, int, int)' /tmp/ccdYM1vV.o:test.cc:(.text+0x1e): relocation...

Inter-dependencies between static libraries

eclipse,gcc,linker,dependencies,static-libraries
I am trying to link two libraries libA.a and libB.a along with a main.c file. libB has dependencies on libA, and main has dependencies on both. I am able to compile the libraries independently, but when I try to link them together to create the final executable, I get the...

Visual Studio: which source file includes a particular library (with “pragma comment”)?

c++,visual-studio,visual-studio-2013,linker
EDIT:solved with James McNellis' suggestion, which led me to the offending library. It was one I hadn't checked with dumpbin. I'm building a Visual Studio 2013 project that links against static libraries using "#pragma comment" instead of listing the libraries in the project properties. After replacing the libraries with new...

undefined reference to some of the opencv functions

c++,eclipse,opencv,linker
I'm trying to compile the 'motemple.c' that comes with the opencv samples in Ubuntu 14.04 environment. I think that opencv has been properly installed; most of the programs are running as expected. However, when compiling the above mentioned file, an error "undefined reference" is raised for several functions. Below is...

How to force linkage to non installed libraries during cross compilation

c++,c,gcc,linker
My situation with g++ is the following. I build a shared library called libplugin.so, which is loaded at run-time by an application. This libplugin.so links to some other shared libraries, with the -no-as-needed linker option, and to a static library. Since libplugin.so itself does not use any of the symbols...

Including template code in multiple compilation units, will it always link without inline?

c++,templates,linker
Suppose I have template code in MyHeader.h, which is then included in 2 compilation units, A.cpp and B.cpp. Both of these files then instantiate the same template function, say f<int>(); (the latter defined non-inline in MyHeader.h). As far as I know, what's happening is the following. The compiler generates the...

Linking an SDL/openGL application manually using ld

c,linux,opengl,linker,demoscene
I'm trying to create a minimal sized executable for a demoscene contest. I'm trying to minimize the size of the executable by linking it myself. Here is my minimal main.c, taken from http://www.int21.de/linux4k/ It draws a white triangle on the screen: #include "SDL/SDL.h" #include "GL/gl.h" void _start(){ SDL_Event event; SDL_SetVideoMode(640,480,0,SDL_OPENGL|SDL_FULLSCREEN);...

mpich2 visual studio 2013 linker error

c++,visual-studio-2013,linker,mpich
I want to use mpi in c++ way, so I have code of cxxpi.cxx from mpich2 examples: #include "mpi.h" #include <iostream> #include <math.h> using namespace std; double f(double); double f(double a) { return (4.0 / (1.0 + a*a)); } int main(int argc, char **argv) { int n, myid, numprocs, i;...

linker command failed with exit code 1 - Xcode

c++,ios,xcode,linker
I keep getting this error and I don't know why. I've implemented this method in other applications but for some reason it's not working for this one... I have the following: ViewController.h: NSInteger HighScore; ViewController.m: - (void)viewDidLoad { ... //load highscores HighScore = [[NSUserDefaults standardUserDefaults] integerForKey:@"HighScoreSaved"]; HighscoreLabel.text = [NSString stringWithFormat:@"%li",...

Linking libcurl while cross compiling with mingw32 under Linux for Windows

c++,linux,linker,libcurl,mingw-w64
I have compiled libcurl using mingw32 and am trying to link it with my program using mingw32 for a Windows system from my Linux machine. I was outputted the files, libcurl-4.dll libcurl.a libcurl.la libcurl.lai. I have included them in my mingw32 libs folder at: /usr/x86_64-w64-mingw32/lib I was able to find...

Can't link wxWidgets app with Code::Blocks / MinGW

c++,linker,mingw,codeblocks,wxwidgets
I have an already working c++ + wxWidgets app built in Eclipse, with wxWidgets built using MSYS. Now i'd like to try different IDEs, like CodeLite and Code::Blocks, but when i tried them they did'nt work 'cause i was lacking a build.cfg file they wants. So i tried a "clean"...

visual studio cannot resolve static functions

c++,visual-studio,linker,singleton,static-functions
Here is the code and the output. win_main.cpp #include <Windows.h> #include <tchar.h> #include "d3d9_object.h" #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); WNDCLASSEX createWndClassEx(HINSTANCE); HWND createWindow(const wchar_t *caption, HINSTANCE); void exitWithFailure(const wchar_t *message, HINSTANCE); const wchar_t gszWndClassName[] = L"MainWindowClassName"; WNDCLASSEX gWndClassEx; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE,...

Unexpected linker script symbol address

c,gcc,linker
I am using gcc-arm-none-eabi 4.9 2014q4 to do my linking and the symbol addresses are not coming out the way I would expect and need for init. My linker script attempts to create the following sections: MEMORY { SRAM_L (rwx) : ORIGIN = 0x00000000, LENGTH = 32K SRAM_U (rwx) :...

Any tools to find order of .o files to be linked in a project using gcc

linux,visual-c++,gcc,linker,porting
I am porting vc++ project to work on the Linux platform i am using g++ as my compiler. i resolved compiling issues on g++ and able to generate .o files for every source file in vc++ project now i have to link them to produce final executable i can do...

Linking a shared library in executable vs. another shared lib

c++,linux,linker,g++,clang++
tl;dr Are there any differences in the way linux loads and links a shared library if the library is linked by an executable or by another shared library? Background Suppose I have a shared library (e.g. libA.so) containing a class with a static std::map and a set of singleton classes....

undefined references when linking with static library with OTL using a makefile

c++,makefile,linker,g++
I want to link my project to a static library (msodbcsql11.lib), and I want to include it's header (msodbcsql.h) and another header file of a framework otlv4.h) using a simple makefile, but it looks like it can't find the library. Here is my makefile: CC=g++ LDFLAGS= CFLAGS=-c -Wall SOURCES=main.cpp LIBB...

“undefined reference to `_cmocka_run_group_tests'” when running sample CMocka test

c,gcc,linker,undefined-reference,cmocka
I installed the CMocka testing framework and tried the sample code: #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmocka.h> /* A test case that does nothing and succeeds. */ static void null_test_success(void **state) { (void) state; /* unused */ } int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(null_test_success),...

Two cells same input in excel

excel,linker,cells
I am searching for a solution in excel. My goal is to enter a value in two different sheets but this value is the same in condition that if we change a value in any of these two sheets it will change automatically in the second one. So I can't...

running error when calling a c library function from assmbly code

c++,c,debugging,assembly,linker
I was trying to develop a better understanding of the linkers and how they work, so I tried to call the simple function(printf) from the c library (MSVCRTD.lib) but with assembly code on MASM. I dissected the external symbols from the "MSVCRTD.lib" library which has many printf's functions like: __imp__printf...

Link error when using AES256 example with OpenSSL

c,linker,openssl
Using gcc 4.8.2 on Ubuntu 14.04 to compile openssl example. gcc SSLsample.c -lssl3 The linker gives undefined symbols: SSLsample.c:(.text+0x25d): undefined reference to `EVP_CIPHER_CTX_new' SSLsample.c:(.text+0x272): undefined reference to `EVP_aes_256_cbc' SSLsample.c:(.text+0x294): undefined reference to `EVP_DecryptInit_ex' SSLsample.c:(.text+0x2bc): undefined reference to `EVP_DecryptUpdate' SSLsample.c:(.text+0x2ed): undefined reference to `EVP_DecryptFinal_ex' SSLsample.c:(.text+0x309): undefined reference to `EVP_CIPHER_CTX_free'...

CMake link library from subdirectory

c++,gcc,linker,cmake,sfml
I am trying to include SFML sources in my project. My directories are laid out like this: main SFML (subtree synced with the official git repo) src <various modules> General (here lies the binary) From the main level I am adding SFML subdirectory first and then src. As I've seen...

undefined reference to `WinMain' : When using Cygwin, SDL2 and Netbeans

c++,netbeans,linker,cygwin,sdl-2
any help here would be appreciated. Ive really racked my brains at this, sooo. I have installed cygwin, and Netbeans and have been successfully deving, compiling and running a small SDL-1.2 windows game with no problems. The problem has come now that I have installed SDL2 and am trying to...

Linking errors from gcc -o0 optimization level

c,gcc,optimization,linker
I have a project where I am trying to do some library and system call benchmarking. I want to make sure that the compiler does not optimize away my calls. Here is my makefile: CC=gcc CFLAGS= -I ./ LIBFLAGS= -lm RM=/bin/rm -f all: osbench osbench: osbench.c $(CC) $(CFLAGS) -o [email protected]

resolve name mangling without c++filt

c++,linker,name-mangling
I need to remove unused functions from a big C++ project. After reading a while I used this link: How can I know which parts in the code are never used? I compile on RedHat using makefiles. I added to compiler the flags: -Wall -Wconversion -ffunction-sections -fdata-sections and to the...

MinGW-W64 linker skipping incompatible files when searching for third-party static libraries

c++,windows,linker,g++,mingw-w64
I'm on Windows 7 64-bit, and I'm compiling with g++ from MinGW-W64. I'm trying to compile an application that I wrote on a Unix computer. I'm running into problems, however, when I try to link against certain third-party lib<name>.lib files. Specifically, I need to link to ROOT libraries. The linker...

assembly - mov unitialized variable?

c,assembly,linker
I have a hard time understanding a piece of code. I read the xv6 lecture at line 1054 Here is the code : .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax orl $(CR4_PSE), %eax movl %eax, %cr4 # Set page directory movl $(V2P_WO(entrypgdir)),...

Linker error with variable templates

c++,templates,linker,c++14,template-variables
Consider the code below: #include <iostream> template<typename T> T n; int main() { n<int> = 42; std::cout << n<int> << std::endl; } It compiles and links with g++5.1, and it displays 42. However, clang++ fails to link it: undefined reference to n<int> If I initialize the template variable like template<typename...

How does Java link lib/rt.jar to your app at runtime?

java,linker,jvm,classloader
The Java standard/system libraries (java.*, javax.*, etc.) are stored in lib/rt.jar inside each JRE distribution. Say I have an application that I have compiled and jarred into myapp.jar. This JAR only contains my app's class files, and merely references system classes like System, File, Runtime, Thread, String, Boolean, etc. So...

holding constructed static arrays in memory for multiple files c++

c++,arrays,dll,linker
I have a few arrays that I need to hold in memory for the duration of my program. The arrays are used as look up references by different files so I thought I should make a DLL to hold them in. The main problem I seem to run into is...

Adding Armadillo to Qt project [SOLVED]

c++,qt,gcc,linker,armadillo
I am trying to run a test for the Armadillo library (5.2) which I have downloaded and I have uncommented the lines ARMA_USE_LAPACK and ARMA_USE_BLAS in the config.hpp file as recommended for Windows here . I have set the .pro file as such QT += core QT -= gui TARGET...

missing .lib file, Dynamic linking confusion

c++,linker,g++,eclipse-cdt
According to this question, Dynamic linking is done at run time, by the operating system. Until now, using g++ with eclipse CDT, I statically linked odbc32.lib I got from windows SDK to get some ODBC functions to my program. But I deleted the file by accident and was surprised to...

How to compile and link google tests in C++ project in Visual Studio 2013 but with Gtest installed by NuGet Package Manager?

c++,visual-studio,linker,nuget,googletest
I have Microsoft Visual Studio 2013 Community Edition on Windows 7. I want to install gtest and gmock for C++ in newer way than downloading headers and binaries or compiling by myself. I found Tools > Nuget Package Manager > Manage Nugets Packages For Solution I chosen Online, then typed...

why can't MATLAB import this python library?

python,matlab,linker,shared-libraries,dyld
I'd like to use http://www.losonczylab.org/sima/1.2/ from within MATLAB. I can run it fine from python. I can import example dependencies in MATLAB. $ /opt/local/bin/python Python 2.7.9 (default, Dec 13 2014, 15:13:49) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>...

Static linking DCMTK library

c++,linux,linker,cmake,dcmtk
I use DCMTK in my application and for compilation use cmake file. cmake finds all libraries (at least headers, because in compiles source files to .o files) the only problem is that during linking it tries to find dynamic libraries for DCMTK. I compiled one as static, so I do...

Issue with Linking order of the libraries

c++,gcc,linker
I am in the middle of porting data from a Visual Studio project to Mingw GCC. I believe I have run into a library linking order issue and am not really sure on how to circumvent this issue. I currently have two files CWavImaData.cpp and CWavData.cpp. Now both these files...

different static linking ways of gcc cause different compilation results

c,gcc,linker,undefined-reference,msgpack
I use msgpack-c 1.0.0, when I compile the following program it failed: #include <msgpack.h> #include <stdio.h> int main(void) { /* creates buffer and serializer instance. */ msgpack_sbuffer* buffer = msgpack_sbuffer_new(); msgpack_packer* pk = msgpack_packer_new(buffer, msgpack_sbuffer_write); int j; for(j = 0; j<23; j++) { /* NB: the buffer needs to be...

Dynamic library “forwarding”

c,linker,shared-libraries
[Edit: In short, the question is: when I link against a dynamic library that is linked against another dynamic library, do I have to explicitly link against that as well?] I saw something like this in a piece of software. It doesn't work and now I am wondering whether it...

Linking my program using g++

c++,linker,g++
I have some problems to build a program using g++. The program is using a library that I have written in C called libiec60063. I want to write my new project in C++ (even if not yet familiar with C++) but I can't manage to link it correctly. For example...

Linker error when using unordered_map but not map?

c++,static,linker
This is a very strange issue. I have two classes: a custom console class (CConsole) and a test class (CHashTableTest) which I've made to play around with maps and unordered_maps to learn how they work. In my console class I have a public static member variable of CConsole that exposes...

Proper way to split declaration and definition of inlined non member operator (linker issue)

c++,visual-studio-2013,linker,inline,operator-keyword
I have a visual studio solution with 2 projects, one of which is a static library. In this library I have the following class with some overloaded operators (both members and not): namespace Vec { class Vec2 { ... inline Vec2& operator +=(const Vec2& b); }; inline Vec2 operator+(const Vec2&a,...

ELF executables: required version information for imported symbols

linux,linker,shared-libraries,elf,dynamic-linking
I was hoping that every dynamically linked ELF binary has a .gnu.version_r section (or another section tagged DT_VERNEED), and that this section contains a required version for every symbol imported from a dynamically linked shared object. Yet, there seem to be cases possible in which the compiler/linker adds an DT_NEEDED...

Set a breakpoint into LibC with gdb

linker,gdb,debug-symbols,libc
Why I cannot set a breakpoint (using gdb) in an exported function within LibC? As being Libc dynamically linked, it must contains the symbols of the functions it exports. Shouldn't I be able to set a breakpoint to any of these functions? I merely tried to do: (gdb) b [email protected]@GLIBC_2.2.5...

(solaris) ld: fatal: … version 'GCC_4.2.0' does not exist

c++,gcc,linker
I'm trying to compile a c++ program for the first time on this machine (which is not mine), so I've written a simple hello world. My command to compile gets an error, >g++ testing.cpp -L/usr/local/lib ld: fatal: file /usr/local/lib/libgcc_s.so: version 'GCC_4.2.0' does not exist: required by file /usr/local/lib/libstdc++.so but I...

Linker command failed with exit code 1 (use -v to see invocation) XCode 6.3

ios,xcode,linker,xcode6
Last night my ApplicationTest started giving error Linker command failed with exit code 1 (use -v to see invocation) and few warnings like Directory not found for option '-L/mobile/Google Directory not found for option '-LAnalytics' i have googled enough but none of answer satisfied my requirements, and now I am...

Finding the last variable in __attribute__(section)

c,linker,cross-compiling,gnu,xilinx
I'm currently working on an embedded system, and in order to meet time constraints I've needed to lock some code in cache. I've placed all the functions I will need to be locked cache into the section MEMORY_CACHEABLE by using the section variable attribute. Because the board I'm using sets...

CMake cannot find a static library using relative file paths

c++,linker,cmake,allegro
I'd like to play around with the Allegro library, but I can't seem to get my test project to link properly. To be exact, I'm getting cannot find -l<...> errors, where <...> is a file I specified using target_link_libraries. (See below for details.) For the record, I'm not all that...

Apple Mach-O Linker Error - duplicate symbols for architecture x86_64

ios,objective-c,xcode,linker,mmrecord
I have tried all the answers available on stackoverflow but nothing seems to be working. I get the following error whenever i create a (TCRecord)subclass of MMRecord. Error: duplicate symbol _MMRecordErrorDomain in: /Users/mavericks/Library/Developer/Xcode/DerivedData/Beered-efrmoegppszsqtbcbtfrytgkdlyy/Build/Intermediates/Beered.build/Debug-iphonesimulator/Beered.build/Objects-normal/x86_64/TCRecord.o...

Using ArrayFire libraries

c++,linker,arrayfire
I downloaded the free version of ArrayFire library. I tried to test matrix multiplication with it. However I got a bunch of undefined references such as matrixdata.cpp:(.text+0x19e5): undefined reference to af::array::array<unsigned char>(int, int, unsigned char const*, af::af_source_t, int) matrixdata.cpp:(.text+0x1a22): undefined reference to af::array::operator=(af::array const&)' matrixdata.cpp:(.text+0x1a31): undefined reference to af::array::~array() Naturally...

g++ include files in other directories

c++,c,compilation,linker,g++
I have a main.cpp file in a directory called test that has an #include "INIReader.h" The structure of the files is like below ---/test/main.cpp ---/inih/ini.h ini.c ---/inih/cpp/INIReader.h INIReader.cpp INIReader.cpp has these includes #include "../ini.h" #include "INIReader.h" I am trying to compile main.cpp in one line with g++ -o test -Wall...

MEMORY command in linker script bloat the binary size

gcc,linker,linker-scripts
I want to have a image which loads at 2 different memory locations and all address linking is done at compile/link time. Overall objective I want to achieve Define different load region for text and data Resolve all symbol dependencies as per load address Put the text and data region...

Assembler with C - Segmentation Fault

c,assembly,linker,segmentation-fault
I have two files: f1.S where is my Fibonacci function (counts n-th member of Fibonacci sequence) written in assembler language and f2.c where the Fibonacci function is called. Here are these files: f1.S .global fibonacci fibonacci: push %rbp movq %rsp, %rbp push %rax movq 16(%rbp), %rax cmp $0, %rax je...

How do I conclude the right directory path when including in CSS/JS/HTML?

javascript,html,css,linker,filepath
considering these directories: /index.html /static/js/x.js /static/css/style.css /static/dist/some_framework_files... /static/img/x.jpg /static/fnt/sans_gio.css In index.html I want to <link> /static/css/style.css and <script src=""> /static/js/x.js In style.css I want to url() /static/img/x.jpg and @import /static/fnt/sans_gio.css And some other different cases... Now I want to know how I should write these files paths in general, how...

C++ Builder XE5 linker error LME1641

c++,linker,c++builder-xe5
I'm having trouble building a project in XE5. I made some basic changes that would in no way cause an issue, but the project fails to build. I have verified that these changes build fine on another machine, and that the projects continues to build on my machine if I...

binutils - kernel - “_binary” meaning?

c,assembly,linker,kernel,binutils
I am reading xv6 lectures. I have a file named initcode.S that is to be linked in the kernel. Now two symbols are created that way : extern char _binary_initcode_start[], _binary_initcode_size[]; inside a function. The lecture says : as part of the kernel build process, the linker embeds that binary...

C++ class merging, linker issue

c++,linker,undefined-behavior
Let's consider the following situation I've discovered today by browsing through a pretty large codebase (real source exemplified for the sake of example): One of the teams created the following two files and a set of interfaces (MoreBase, Base). All is fine till this point. * file1.h * class MoreBase...

link.exe returns error LNK1181: cannot open input file 'C:\Program.obj'

c++,windows,visual-c++,linker,linker-error
I'm compiling with a Batch file containing @echo off set link=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link "%link%" external_input.obj periodic_dinger.obj flagger.obj monitor.obj main.obj libGui.lib libCore.lib libCint.lib libRIO.lib libNet.lib libHist.lib libGraf.lib libGraf3D.lib libGpad.lib libTree.lib libRint.lib libPostscript.lib libMatrix.lib libPhysics.lib libMathCore.lib libThread.lib All the objects and libraries are in the same directory, which is...

The linker link, but the executable ask for another dll

dll,linker
I'm using mingw. I have a dll named gtksourceview-3.0-1.dll, my program is compiled without problem, the linker doesn't report any error, but when I lauch the program, it is asking for another dll: gtksourceview-3.0-0.dll. When I compile with g++, I pass as argument: -lgtksourceview-3.0. Why my program is searching for...

Makefiile with many flags

c++,linux,makefile,linker,intel-mkl
I am trying to learn how a Makefile should look like, when it comes to the flags, especially the linking ones. Here is my Makefile: OBJS = n.o SOURCE = n.cpp # HEADER = there are no header files, so I commented that OUT = test CXX = ../mpich-install/bin/mpic++ FLAGS...

Is there an equivalent of -I (capital I) for object files in g++?

c++,linker,g++
I have several object files coming from different directories (they are stored near the corresponding source that generated them). Is there a way that given this directory structure Root main.o Root/Some_long_path object_1.o object_2.o I could run a command like this g++ -Wall main.o -ISome_long_path object_1.o object_2.o -o app So that...

Visual Studios 2013 - C++ Linker Error with openCV 3.0 Libs

c++,opencv,visual-studio-2013,linker,opencv3.0
Their is a problem with the Linker for C++ in my Visual Studios 2013 on Windows 8. I want to use openCV 3.0 with my Visual Studios. All links inside the code will be used normal and IntelliSense recognize the datamembers. But if I want to compile the programm Visual...

C: linker command failed with exit code 1

c,linker
I'm having a problem when I compile my code. I'm not getting any error messages. However, I am getting the following message: Undefined symbols for architecture x86_64: "_lookup", referenced from: _main in sixteen2-85c27c.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use...

__isr_vectors variable not found when placed inside a static library

gcc,linker,arm,static-libraries,linker-scripts
As a spin-off of a previous question (sbrk function not found when placed in a static library): I'm creating a bare-metal application for the stm32f407 microcontroller, which has an ARM Cortex M4 core. I'm trying to create a static library containing basic stuff like cmsis, the HAL functions, and the...

Link and call two separate mains

c,gcc,linker,ld
Is it possible through some linker magic to link together two files with two separate main()s, then add a third controlling main() that would decide at run time which of the other two mains to call? So imagine: /* test1.c */ include <stdio.h> int main() { printf("Test1\n"); } /* test2.c...

Reference undefined to functions in python-dev header

python,c,gcc,linker
I'm trying to embedding some Python code into C; It's the first time I do a thing like that. Here is the simple code of my first attempt copied by a guide on internet: #include <Python.h> void exec_pycode(const char* code) { Py_Initialize(); PyRun_SimpleString(code); Py_Finalize(); } int main(int argc, char **argv)...

gcc links to wrong GLIBCXX version when O2 flag is specified

c++,linux,gcc,linker,ld
I have a shared library file which I build using a Makefile. I ran into an issue where, after building the library, I'd get the dreaded GLIBCXX_ not found linker error. This case is particularly strange. When I compile with the -g3 flag, I don't get the error. If I...

Linker error compiling DX10 program in Visual Studio 2015

visual-studio,visual-c++,linker,directx
I am trying to compile old program which works with DirectX 10. Full list of libraries used: #pragma comment(lib, "d3d10.lib") #pragma comment(lib, "d3dx10.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "dxerr.lib") #pragma comment( lib, "dxguid.lib" ) Linker error: dxerr.lib(dxerrw.obj) : error LNK2019: unresolved external symbol _vsnwprintf referenced in function "long __cdecl StringVPrintfWorkerW(unsigned...

Linux - process killed when linking section into lowest 2 MB of memory?

linux,linker,ld,virtual-memory,linker-scripts
I'm learning about LD linker scripts, and I noticed that if I link the .text section (or any section) at an address lower than than 2 MB, my process gets instantly killed by Linux as soon as I run it. Here's an example script I'm using: SECTIONS { . =...

Protobuf cannot be linked on ubuntu

c++,ubuntu,linker,cmake,protocol-buffers
I try to use protobuf but somehow the linking fails (here just snippet): Linking CXX executable app CMakeFiles/app.dir/msg.pb.cc.o: In function `evoswarm::protobuf_AssignDesc_a_5fto_5fb_2eproto()': msg.pb.cc:(.text+0x133): undefined reference to `google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(google::protobuf::Descriptor const*, google::protobuf::Message const*, int const*, int, int, int, int, int, int)' msg.pb.cc:(.text+0x190): undefined reference to...

Interesting GCC Linking

c,pointers,gcc,linker,dynamic-linking
I was playing around with symbols and function pointers recently and noticed that though the following code runs fine: #include <stdio.h> int main(int argc, const char * argv[]) { printf("%p\n",printf); // <--this line makes it work int (*printfptr)(const char * restrict, ...); printfptr = 0x1001fe910; (*printfptr)("Hello world\n"); return 0; }...

LD giving strange error and not finding an existing file when using ARM gcc

c,gcc,linker,arm
This is the command line executed by my Makefile: arm-none-eabi-gcc bubblesort.c -O0 -mcpu=cortex-m0 -mthumb -Wl, -T ../boot_and_link/linker.ld -l ../boot_and_link/startup.o As I understand it, it should compile bubblesort.c for a CortexM0 and then the linker should you use linker.ld as a linker script and should also link startup.o with the output...

Can't properly link libraries when compiling with Waf

c++,build,linker,shared-libraries,waf
I'm trying to compile a program that depends on Caffe using Waf (not my program, just trying to build it). During linking, I was getting the error /usr/bin/ld: cannot find -lcaffe So I added the path to libcaffe.so to obj.libpath in wscript and it compiled. Yet when I run the...

_sbrk function not found when placed in a static library

c,gcc,linker,arm
I'm creating a bare-metal application for the stm32f407 microcontroller, which has an ARM Cortex M4 core. As such, I'm delivering the implementation of functions like _sbrk myself. I now find that when I try to create a static library containing _sbrk, and link it with my main.c into an application,...

glew linking problems qt creator qmake

opengl,linker,qt-creator,qmake,glew
I am trying to get a project working with SDL2, assimp, opengl, and glew and cannot get glew to link properly (almost a duplicate but a more comprehensive question and answer, I think). My qmake .pro file : CONFIG += console CONFIG -= app_bundle CONFIG -= qt HEADERS += \...

How are function calls resolved?

c,function,linker
When a function is called, execution is shifted to a point indicated by the function pointer. At the start of execution, the executable code has to be loaded from disk. How is the correct function pointer called? The executable code is not mapped into virtual memory at the same location...

gcc compilation with linker - differences

c,gcc,linker
This will compile main.c and link created .o file statically with with abc library and dynamically with xyz gcc main.c -Wl,-Bstatic -labc -Wl,-Bdynamic -lxyz -o main But I am not sure about some other combinations: This will compile main.c to main - but what -lm will do in this case?...

Could not exec the linker `cc` error when running “cargo build”

osx,linker,rust,rust-cargo
I just installed Rust on my Mac and rustc --version --verbose displays rustc 1.0.0-nightly (91bdf23f5 2015-03-09) (built 2015-03-08) binary: rustc commit-hash: 91bdf23f504f79ed59617cde3dfebd3d5e39a476 commit-date: 2015-03-09 build-date: 2015-03-08 host: x86_64-apple-darwin release: 1.0.0-nightly I cloned a couple of repositories (postgres-extension and erlang-rust-nif) and ran cargo build upon both of them. Both reported the...

How can I link cpufeatures lib for a native android library?

android,c++,gcc,android-ndk,linker
I'm trying to link android's cpu_features to a native library. I'm using android's gcc compiler directly as a cross compiler. (NOT ndk-build). I've included the header ($NDK_PATH/sources/android/cpufeatures/cpu-features.h), but i don't see a prebuilt libcpufeatures.a file anywhere under the ndk folder. How can I build that library? Or where can it...

Why visual studio needs a static library (.lib) for dynamic linking?

c++,visual-studio-2013,linker,static-linking,dynamic-linking
I want to use some dll in my project ( VS2013 - c++ ), I gave the path of dll and headers using "project->properties->vc++ directories", and after building the project, linker errors (common "unresolved external symbol") appears. the problem can be solved by giving the .lib file to the linker!...

Apple Mach-O Linker Error, after changing project name

xcode,swift,error-handling,linker,apple
Im making an app in Xcode 6.1.1, and just changed the name of the app, and afterwards im getting this "Apple Mach-O Linker Error" build failed error. It says "ld: file not found:", so it properly because it cant find the placement of some file with the new name.. any...

Does anything happen at build time that is specific to static linking

c++,linker,static-linking,scons,dynamic-linking
I tried to statically link some built libraries using the static option in the linker. I'm using SCons to compile/link the libraries. I was under the impression that static builds happen at link time, and therefore it did not matter what you were linking. I got a bunch of errors...

cmake command to verify libraries?

c++,linker,cmake
Is there a cmake command that is equivalent to "otool -L" ? I would like to have this information for a third party library before I add it as a target to my project....