C++ Linking Error: invalid DSO for symbol


 
Thread Tools Search this Thread
Top Forums Programming C++ Linking Error: invalid DSO for symbol
# 1  
Old 01-09-2015
BSD C++ Linking Error: invalid DSO for symbol

I am on a FreeBSD system trying to build a piece of software that I wrote. I had built it in the past but recently reinstalled FreeBSD. I am not sure what is going on. The software depends on and wxgtk2.8.

Using g++:
Code:
$ make
g++ -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/gnrcabt.cpp
g++ -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/abc.cpp
g++ -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/main.cpp
Making project myabcs version 0.4.5.
g++ -v -s `wx-config --libs` gnrcabt.o abc.o main.o -o myabcs 
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/lto-wrapper
Target: x86_64-portbld-freebsd10.1
Configured with: ./../gcc-4.8.4/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48
--libexecdir=/usr/local/libexec/gcc48 --program-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection'
--with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local
--mandir=/usr/local/man --infodir=/usr/local/info/gcc48 --build=x86_64-portbld-freebsd10.1
Thread model: posix
gcc version 4.8.4 (FreeBSD Ports Collection) 
COMPILER_PATH=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/:/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/:/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/:/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/:/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/
LIBRARY_PATH=/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/:/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-s' '-L/usr/local/lib' '-pthread' '-fstack-protector' '-L/usr/local/lib' '-o' 'myabcs' '-shared-libgcc'
'-mtune=generic' '-march=x86-64' /usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/collect2 --eh-frame-hdr -V
-dynamic-linker /libexec/ld-elf.so.1 -o myabcs -s /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/crtbegin.o
-L/usr/local/lib -L/usr/local/lib -L/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4
-L/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/../../.. -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8
-lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8
gnrcabt.o abc.o main.o -lstdc++ -lm -lssp_nonshared -lgcc_s -lgcc -lpthread -lc -lgcc_s
-lgcc /usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/crtend.o /usr/lib/crtn.o
GNU ld (GNU Binutils) 2.25
  Supported emulations:
   elf_x86_64_fbsd
   elf_i386_fbsd
   elf_x86_64
   elf_i386
   elf_l1om
   elf_l1om_fbsd
   elf_k1om
   elf_k1om_fbsd

Using clang:
Code:
$ make CC=clang
clang -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/gnrcabt.cpp
clang -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/abc.cpp
clang -c `wx-config --cxxflags` -DPIXMAPDIR="\"/usr/local/share/pixmaps\""  -DABCDIR="\"/usr/local/share/myabcs\"" -Iinclude src/main.cpp
Making project myabcs version 0.4.5.
clang -v -s `wx-config --libs` gnrcabt.o abc.o main.o -o myabcs 
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
Selected GCC installation: 
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o myabcs /usr/lib/crt1.o
/usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib -L/usr/local/lib -L/usr/lib -s -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8
-lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8
-lwx_baseu_net-2.8 -lwx_baseu-2.8 gnrcabt.o abc.o main.o -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed
-lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
/usr/bin/ld: //usr/lib/libc++.so.1: invalid DSO for symbol `_ZdlPv' definition
//usr/lib/libc++.so.1: could not read symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Not sure what is going on. I'll have to see if I can compile another program with wxgtk.

Last edited by AntumDeluge; 01-09-2015 at 10:45 AM.. Reason: wrapping lines for readability
# 2  
Old 01-09-2015
It is hard to say - it looks like a mismatch, perhaps a shared object file with newer or missing symbols. Although - a reinstall should not have caused a problem, were there some updates to the reinstall that you deferred?
# 3  
Old 01-09-2015
I don't think there were any updates that would have effected it. I just built another project that uses wxgtk2.8 and it works fine. I must have done something to my compiler commands in the Makefile.
# 4  
Old 01-09-2015
What's the output from
Code:
wx-config --cxxflags
wx-config --libs

What are the C++ flags used on the source that worked?
# 5  
Old 01-09-2015
Code:
$ wx-config --cxxflags --libs
-I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-D__WXGTK__ -pthread -D_THREAD_SAFE
-L/usr/local/lib -pthread  -fstack-protector  -L/usr/local/lib   -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8
-lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8
-lwx_baseu-2.8


Last edited by AntumDeluge; 01-09-2015 at 10:46 AM.. Reason: wrapping for readability
# 6  
Old 01-09-2015
There's not much there that could cause a problem. I don't see any support for "-fstack-protector" in the clang documentation, though.

What's the output from "file .../main.o" and all your other object files, from both GCC and clang? Maybe something shows up there.

Hopefully you're not running up against a compiler bug.
# 7  
Old 01-09-2015
"Invalid DSO" can sometimes mean "symbol not found" these days. I got that error while linking -lssl but not linking -lcrypto too.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Linux

Help with Linux linking error

Hi, Currently I am migrating codes from unix to Linux. When doing linking(ld) getting the below error. Error is :ld: invalid BFD target `--shared' Providing the script of the ld: ld -b -G -o lib/libatk.so ./src/atk_db.o ./src/atk_gcl.o ./src/atk_options.o ./src/atk_exception.o... (1 Reply)
Discussion started by: jrkar
1 Replies

2. Programming

C program multiple definition error during linking time

Hi, I have the following files: // file.hvoid foo(); int i = 5; // should be just declared as extern int i; // file1.c#include <stdio.h> #include "file.h" void foo() { i = 10; printf("%d\n", i); } // file2.c#include <stdio.h> #include "file.h" int main() { foo(); (9 Replies)
Discussion started by: royalibrahim
9 Replies

3. Shell Programming and Scripting

01.30 Invalid shell error

Hi, I am getting the error 01.30 Invalid shell error I am running the bash shell script in the korn login shell. I have mentioned the #!/bin/bash statement in the my script but not sure why it is giving this error to me.. (4 Replies)
Discussion started by: mr_harish80
4 Replies

4. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

5. Web Development

Apache + DSO PHP

Hello, guys! I have a web server that uses PHP as DSO. Do you know any tool that can help me monitoring the CPU usage for any domain/subdomain that is hosted on this server? (1 Reply)
Discussion started by: Sergiu-IT
1 Replies

6. Programming

Symbol referencing error

Hey everyone, I can't figure out this symbol referencing error after looking at it for the longest time, and I figured some fresh eyes might be able to point something out I am overlooking. Undefined first referenced symbol in... (1 Reply)
Discussion started by: fromatz
1 Replies

7. UNIX for Dummies Questions & Answers

Link error while linking a shared library in unix

Getting the following error , ld: /opt/syncsort39/lib/libsyncsort.sl: Mismatched ABI. 64-bit PA shared library found in 32-bit link. Is there any difference in the ld options in opt file while linking a 64 bit shared library ? Or is the problem because we are trying to link both 32 bit and 64... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

8. Programming

symbol referencing error

Undefined first referenced symbol in file std::basic_ostream<char, std::char_traits<char> >::operator<<(int)/var/tmp//ccTR std::cerr /var/tmp//ccTRcjui.o std::cout /var/tmp//ccTRcjui.o... (1 Reply)
Discussion started by: suhasini
1 Replies

9. Programming

Linking problem while linking to shared library

Hi I'm getting ld: fatal: option -h and building a dynamic executable are incompatible ld: fatal: Flags processing errors When I run ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o after running gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c I'm... (6 Replies)
Discussion started by: laho
6 Replies
Login or Register to Ask a Question