linker

slam package install fails with make error

人盡茶涼 提交于 2019-12-18 16:55:09
问题 I'm trying to install the slam package, but it seems to fail on my system. I'm running ubuntu 12.04. I thought it was a missing library or something so I installed a few that match liblas, but no dice. * installing *source* package ‘slam’ ... ** package ‘slam’ successfully unpacked and MD5 sums checked ** libs gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c grouped.c -o grouped.o gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c sparse.c -o sparse.o gcc

how to specify alternate linker command when linking with 'cc'

巧了我就是萌 提交于 2019-12-18 16:11:26
问题 When you use cc(1) to link a program, it will invoke a default linker command. For instance, your version of the compiler may have been built to use /usr/bin/ld by default on a unix-like platform. Is there a way to specify a different linker command that cc(1) (or c++(1) ) should use (e.g., /usr/local/bin/ld instead of /usr/bin/ld )? I'm interested mostly in gcc and clang. I'm not looking for methods that involve running the various compilation steps separately (e.g., pre-process, compile,

Link error when declaring public static variables in C++

回眸只為那壹抹淺笑 提交于 2019-12-18 15:54:56
问题 I have this class with variable configuration parameters. I want to include it in other classes: JugadorHumano , JugadorIA , Main , PartidaClasica , PartidaMision . #pragma once class Configuracion { public: static int MAX_ATAQUES; static int DIV_TERRITORIOS; }; int Configuracion::MAX_ATAQUES = 5; int Configuracion::DIV_TERRITORIOS = 3; What I want is to be able to modify or read the values from the other classes. I can't declare a static variable and define it in the declaration. I can't let

cannot load shared library that exists in /usr/local/lib (Fedora x64)

我只是一个虾纸丫 提交于 2019-12-18 15:54:10
问题 When attempting to run a program I just compiled successfully, I get the following error: ./src/sensors/laser_scan_producer: error while loading shared libraries: liblcm.so.1 : cannot open shared object file: No such file or directory ls /usr/local/lib/liblcm* yields /usr/local/lib/liblcm.la /usr/local/lib/liblcm.so /usr/local/lib/liblcm.so.1 /usr/local/lib/liblcm.so.1.2.0 I have executed sudo ldconfig several times and added /usr/local/lib to LD_LIBRARY_PATH for the sake of redundancy. This

Linker problems in Ubuntu 11.10

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 15:53:19
问题 after upgrading to Ubuntu 11.10, I've found that many of my old and current developments can't be compiled anymore. I've reduced the problem to a simple example: #include <X11/Xlib.h> int main() { Display* display = XOpenDisplay(":0.0"); XCloseDisplay(display); return 0; } Compiling it using: g++ -lX11 test.cpp or g++ -c -o test.o test.cpp g++ -lX11 -o test test.o Causes a failure to happen: /tmp/ccBAOpzy.o: In function `main': test.cpp:(.text+0x11): undefined reference to `XOpenDisplay' test

Function mocking (for testing) in C?

◇◆丶佛笑我妖孽 提交于 2019-12-18 14:54:17
问题 I would like to write tests for a C library, in C. I'd like to mock out some functions for the test. Suppose my library is compiled from the following source: /* foo.h */ int myfunction(int x, int y); /* foo.c */ #include "foo.h" static int square(int x) { return x * x; } int myfunction(int x, int y) { return square(x) + square(y); } I want to write a test like this: /* foo_test.c */ #include "foo.h" static int square(int x) { return x + 1; } int main(void) { assert(myfunction(0, 0) == 2);

How can I resolve “error LNK2019: unresolved external symbol”? [duplicate]

自作多情 提交于 2019-12-18 14:45:22
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (32 answers) Closed 5 years ago . I've got this MFC application I'm working on that needs to have an embedded database. So I went hunting for a slick, fast "embeddable" database for it and stumbled accross SQLite. I created a DB with it, and I created a static library project with Visual Studio 2008. the library project will be used in another main project. In the

R package that links to external C library

一笑奈何 提交于 2019-12-18 14:19:33
问题 I have some c code that utilizes the igraph library. I would like to put an R wrapper around it and send it off to CRAN as an R package. igraph already has an R port on CRAN, so it would make sense for my R package 'foo' to depend on R's igraph. Since foo uses its own C code that depends on the C igraph, how can I link my C functions to the original igraph library? I've read that this is done in a file called Makevars, but linking to an external library is very hairy. If this isn't possible,

ld cannot find -l<library>

不问归期 提交于 2019-12-18 14:18:29
问题 I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error: /usr/bin/ld: cannot find -lcoinhsl Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/ does anyone have a solution for this? below is the complete return of running setup.py build: root@ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build running build running build_ext building 'pyipopt' extension gcc -pthread -fno

How to set _ITERATOR_DEBUG_LEVEL in VS2010?

核能气质少年 提交于 2019-12-18 14:17:19
问题 We are using a library by another vendor, which apparently was compiled with the wrong flags, namely _ITERATOR_DEBUG_LEVEL = 0 in 32bit-Debug-mode. While I have already filed a bug report with them, I need an intermediate solution. We do not use stl ourselves, so I am free to change this flag for the subproject that uses said library. But I cannot figure out how to do so. What I tried an didn't work: /D_ITERATOR_DEBUG_LEVEL=0 > LINK : warning LNK4044: unrecognized option '/D_ITERATOR_DEBUG