All Questions
20 questions
1
vote
1
answer
519
views
Get GCC to Remove C++ 11 Flag in Mangled Name
I'm debugging a build that links against JsonCpp and I get a linker error where the demangled name it's trying to link to is _ZNK4Json6Reader25getFormattedErrorMessagesB5cxx11Ev and the one the ...
0
votes
1
answer
513
views
Dynamic Linker does not resolve symbol although the library is already loaded
I stumbled over the following problem in my large-grown project: I have a set of libraries which depend on each other and on external libraries. Of one dependency ("libvtkCommonCore-*.so"), ...
3
votes
1
answer
252
views
g++ does not link depending on optimization settings
So, this is eating me for the last two days:
I can't link my application, depending on which compiler I use and what optimizations levels are used:
gcc plays nicely with -O1, -O2, -O3 but fails with -...
2
votes
2
answers
222
views
Pb of Fortran <-> C++ interoperability if I compile the fortran with the option -finit-local-zero
I've found out a strange result while linking a program with C++ and Fortran.
The test (see after) is very simple : define a variable in a fortran module and access it in the C++ program.
If I ...
1
vote
0
answers
2k
views
GCC not using proper version of std::string
Why is GCC using std::string instead of std::__cxx11::basic_string
this is not a duplicate of this because i am already using different versions. Please read the question and explanation before ...
1
vote
1
answer
148
views
GCC on Linux searching for a forward declared method in the wrong namespace
Consider the following scenario:
Source.cpp
int add(int a, int b) { return a + b; } // function in global scope
Header.h
namespace ns
{
class A
{
public:
void do()
{
...
0
votes
1
answer
857
views
Undefined reference to cxx11 functions in app built with GCC 4.8.5
On my workplace we've got project consisting of many apps that need to be built both for ARM and x86. ARM version builds fine with Marvell GCC 4.8.5 cross toolchain. Now I'm working on x86 build (GCC ...
3
votes
2
answers
7k
views
g++ cannot find shared library
I apologize that this is redundant, but none of the answers available seem to be able to solve my problem. I am attempting to compile an executable using a shared object library. The shared object ...
7
votes
1
answer
5k
views
How to Compile boost with GCC 5 using old ABI?
I have downloaded a library that was compiled with a gcc 4.8 before the ABI change in GCC.
On my laptop (latest kubuntu) I have GCC 5.2. And When I installed boost, it seems that it used the new ABI ...
0
votes
1
answer
2k
views
Undefined reference when using lambda
The following code produces undefined reference error on c++ (Debian 4.7.2-5) 4.7.2:
#include <signal.h>
class Lol {
public:
void foo() {
struct sigaction sa;
sa.sa_flags = ...
4
votes
1
answer
2k
views
Linker error for functions expecting const std::string &
When trying to link against a shared library (gtkmm), I get linker errors for functions whose signature contains a std::string const&.
For example, if the function is declared as
void ...
0
votes
0
answers
397
views
Compile and use a custom version of libstdc++ as a regular user
I have to compile and run a modern program on a cluster with an outdated OS. The program employs some c++11 features and STL templates. The cluster's compiler toolchain (g++ v 4.4.7) supports almost ...
0
votes
2
answers
475
views
Why don't we use directly Object files? [duplicate]
^
Not a duplicate, here I'm investigating why one method is preferred, not wich are the differencies, a carefull read would make it glaring to peer reviewers it is not a duplicate.
I was reading that:...
-1
votes
1
answer
2k
views
G++/GCC Compiler is giving undefined reference error when optiomzation is turned off
I have a HUGE C++ program which compiles fine with -O3 optimization but gives a "undefined reference to strings_array_multilevel variable" error, when compiled with -g option (-O3 is removed).
I have ...
1
vote
3
answers
6k
views
How to distribute c++11 shared library on centos6
I have a c++11 library ( https://github.com/matiu2/cdnalizer ). I want to distribute it on centos6 and ubuntu12.04 LTS.
It compiles happily on Ubuntu 13.10 and Gentoo.
I tried compiling with as much ...
1
vote
1
answer
3k
views
x86_64-pc-cygwin-gcc linker error
I setup in my cygwin environment the x86_64-pc-cygwin-gcc package to get a recent gcc
$ x86_64-pc-cygwin-gcc --version
x86_64-pc-cygwin-gcc (GCC) 4.8.1
I have a small code file that you can find ...
5
votes
1
answer
38k
views
undefined reference to std::basic_string
I'm compiling my project and seeing link problem
$ g++ -Wl,-z,now -Wl,-z,relro -pthread -Wl,-z,noexecstack -fPIC -Wl,--threads -Wl,--thread-count=4 -B../../third_party/gold -L. -Wl,-...
1
vote
1
answer
2k
views
static const int member and undefined reference
I use gcc 4.7.3 for ARM platform to compile my code. I have several classes like this:
// types.h
enum Types
{
kType1,
kType2
// ...
};
// d1.h
class D1 : public Base
{
public:
...
0
votes
1
answer
1k
views
Weakly defining function at link-time, and testing for override
(Environment: gcc 4.6, c++11, glibc 2.13, binutils 2.21)
Please consider the follow "linking" demo for background:
foo.h:
#pragma once
#include <iostream>
void foo();
foo1.cpp:
#include "...
6
votes
1
answer
14k
views
C++ std library linking with different C++ standards
I am compiling a project using Cygwin (GCC v4.5.0) and I'm having an odd linker problem. I am hoping somebody with some expertise can help.
Error: undefined reference to std::basic_string<char, ...