libpam linking issue ubuntu 12.04 - gcc

I have installed
libpam0g-dev libpam0g
But when I am linking to libpam I am getting error undefined reference to `pam_start'
and I am linker flags include -lpam.
Same code is working in Ubuntu 11.
Linking flags
-Wl,--start-group -lssl -lpam -lcrypto -lnspr4 -licui18n -licuuc -licudata -lcurl -lcares -lpthread -lpcrecpp -loauth -ldl -lrt -lz -Wl,--end-group
don't works
but this works
-Wl,--start-group -lssl -lpam -lcrypto -lnspr4 -licui18n -licuuc -licudata -lcurl -lcares -lpthread -lpcrecpp -loauth -ldl -lrt -lz -lpam -Wl,--end-group

Related

Compile V8 on linux platform failed

compile the latest v8 failed on linux platform.
linux, v8 using ninjia
ninja: Entering directory `out.gn/x64.release'
[14/571] LINK ./mksnapshot
o/x/args.gn+ buffers
FAILED: mksnapshot
../../third_party/llvm-build/Release+Asserts/bin/clang++ -pie -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -m64 -rdynamic -pie -Wl,--disable-new-dtags -Wl,-O2 -Wl,--gc-sections -o "./mksnapshot" -Wl,--start-group #"./mksnapshot.rsp" -Wl,--end-group -latomic -ldl -lpthread -lrt
ld.lld: error: undefined symbol: void std::atomic_init(std::atomic*, bool)
referenced by module-compiler.cc:260 (../../src/wasm/module-compiler.cc:260)
obj/v8_base_without_compiler/module-compiler.o:(v8::internal::wasm::CompilationState::New(std::shared_ptr const&, std::shared_ptr))
link error
This problem has been solved by replacing std::atomic_init with straight assignment.

Undefined reference errors while linking in makefile

I have a set of cross compiled dynamic libraries generated. While trying to link it, I am getting the following error:
arm-linux-ld: xxx.so: undefined reference to symbol '__aeabi_uldivmod##GCC_3.5'
Does anybody have any idea what I am missing?
Below is the libraries I am linking and the order of linking:
some user defined libraries + -lcrypto -lssl -lz -lpthread -lxml2
-lcsvparser -lubox -lini -lyuarel -lsqlite3 -lcurl -lm -ldl -lrt -lc -lgcc

link ffmpeg error with cmake

I use cmake to create my project using ffmpeg lib, the project is simple.
add_executable(testffmpeg main.cpp)
link_directories( /usr/lib/x86_64-linux-gnu )
target_link_libraries(testffmpeg libavcodec.a libavutil.a )
When make, there's lots of undefined reference errors (my default cxx compiler is clang by "export cxx=/usr/bin/clang++").
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libavcodec.a(crystalhd.o): In function `receive_frame':(.text+0xef): undefined reference to `DtsProcOutputNoCopy'
but when I just use command, it's OK.
clang -o testffmpeg -lavutil -lavcodec main.cpp
while using gcc also get this error
gcc -o testffmpeg -lavutil -lavcodec main.cpp
so, how can I resolve this problem and where is the mistake?
You need add -lcrystalhd in your linker flags.
You can use code below to find all linker flags.
pkg-config --libs libavformat
-L/usr/local/lib -lavformat -lXv -lX11 -lXext -ldl -lvdpau -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lsndio -ljack -lasound -lSDL2 -lx264 -lcrystalhd -lm -llzma -lbz2 -lz -pthread -lavcodec -lXv -lX11 -lXext -ldl -lvdpau -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lsndio -ljack -lasound -lSDL2 -lx264 -lcrystalhd -lm -llzma -lbz2 -lz -pthread -lswresample -lm -lavutil -lm

How to fix library not found -lX11 errors while compiling Wordnet on MAC OSX?

When compiling Wordnet 3.0 on Mac OSX, I get warnings about missing libraries.
library not found for -lX11
Remove all static X libraries from the Makefile.
Original
TK_LIBS = -L/usr/X11/lib -lX11 -Wl,-weak-lXss -lXext -L/usr/X11/lib -lXft -lX11 -L/usr/X11/lib -lfreetype -L/usr/X11/lib -lfontconfig -L/usr/X11/lib -lXrender -lX11 -lpthread -fra>
Changed
TK_LIBS = -L/usr/X11/lib -Wl -L/usr/X11/lib -lpthread -framework CoreFoundation -lz -lpthread -framework CoreFoundation.
Need to do this in src/Makefile.

Error running make when installing Ruby 1.8.7-p302 via RVM on Mac OS 10.5.8

Running "rvm install 1.8.7-p302" provides the following feedback:
rich-macbook:~ rich$ rvm install 1.8.7-p302
Installing Ruby from source to: /Users/rich/.rvm/rubies/ruby-1.8.7-p302, this may take a while depending on your cpu(s)...
ruby-1.8.7-p302 - #fetching
ruby-1.8.7-p302 - #extracted to /Users/rich/.rvm/src/ruby-1.8.7-p302 (already extracted)
Applying patch 'stdout-rouge-fix' (located at /Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch)
ERROR: Error running 'patch -F 25 -p1 -N -f <"/Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/rich/.rvm/log/ruby-1.8.7-p302/patch.apply.stdout-rouge-fix.log
ruby-1.8.7-p302 - #configuring
ruby-1.8.7-p302 - #compiling
ERROR: Error running 'make ', please read /Users/rich/.rvm/log/ruby-1.8.7-p302/make.log
ERROR: There has been an error while running make. Halting the installation.
This is the second attempt at installing it; the first time the patch installed fine, but Ruby itself failed running make. I have recently installed Ruby 1.9.3-p0 without problem.
Below is the output of the mentioned log files.
patch.apply.stdout-rouge-fix.log
[2011-12-01 08:06:45] patch -F 25 -p1 -N -f <"/Users/rich/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"
patching file lib/mkmf.rb
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej
make.log:
[2011-12-01 08:07:04] make
/usr/bin/gcc-4.2 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch x86_64 -bind_at_load main.o dmydln.o libruby-static.a -ldl -lobjc -o miniruby
rbconfig.rb unchanged
cc -dynamiclib -undefined suppress -flat_namespace -install_name /Users/rich/.rvm/rubies/ruby-1.8.7-p302/lib/libruby.dylib -current_version 1.8.7 -compatibility_version 1.8 array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o -o libruby.1.8.7.dylib
ld warning: in array.o, file is not of required architecture
ld warning: in bignum.o, file is not of required architecture
ld warning: in class.o, file is not of required architecture
ld warning: in compar.o, file is not of required architecture
ld warning: in dir.o, file is not of required architecture
ld warning: in dln.o, file is not of required architecture
ld warning: in enum.o, file is not of required architecture
ld warning: in enumerator.o, file is not of required architecture
ld warning: in error.o, file is not of required architecture
ld warning: in eval.o, file is not of required architecture
ld warning: in file.o, file is not of required architecture
ld warning: in gc.o, file is not of required architecture
ld warning: in hash.o, file is not of required architecture
ld warning: in inits.o, file is not of required architecture
ld warning: in io.o, file is not of required architecture
ld warning: in marshal.o, file is not of required architecture
ld warning: in math.o, file is not of required architecture
ld warning: in numeric.o, file is not of required architecture
ld warning: in object.o, file is not of required architecture
ld warning: in pack.o, file is not of required architecture
ld warning: in parse.o, file is not of required architecture
ld warning: in process.o, file is not of required architecture
ld warning: in prec.o, file is not of required architecture
ld warning: in random.o, file is not of required architecture
ld warning: in range.o, file is not of required architecture
ld warning: in re.o, file is not of required architecture
ld warning: in regex.o, file is not of required architecture
ld warning: in ruby.o, file is not of required architecture
ld warning: in signal.o, file is not of required architecture
ld warning: in sprintf.o, file is not of required architecture
ld warning: in st.o, file is not of required architecture
ld warning: in string.o, file is not of required architecture
ld warning: in struct.o, file is not of required architecture
ld warning: in time.o, file is not of required architecture
ld warning: in util.o, file is not of required architecture
ld warning: in variable.o, file is not of required architecture
ld warning: in version.o, file is not of required architecture
ld warning: in dmyext.o, file is not of required architecture
compiling Win32API
compiling bigdecimal
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/bigdecimal.bundle bigdecimal.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling curses
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/curses.bundle curses.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lncurses -ltermcap -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling dbm
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/dbm.bundle dbm.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling digest
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/digest.bundle digest.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
cp ../.././ext/digest/digest.h ../../.ext/i686-darwin9.8.0
compiling digest/bubblebabble
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/bubblebabble.bundle bubblebabble.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling digest/md5
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/md5.bundle md5init.o md5ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling digest/rmd160
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/rmd160.bundle rmd160init.o rmd160ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling digest/sha1
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/sha1.bundle sha1init.o sha1ossl.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -lcrypto -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling digest/sha2
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/digest/sha2.bundle sha2.o sha2init.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling dl
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/dl.bundle dl.o handle.o ptr.o sym.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
cp dlconfig.h ../../.ext/i686-darwin9.8.0
cp ../.././ext/dl/dl.h ../../.ext/i686-darwin9.8.0
compiling etc
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/etc.bundle etc.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling fcntl
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/fcntl.bundle fcntl.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling gdbm
compiling iconv
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/iconv.bundle iconv.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -liconv -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling io/wait
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/io/wait.bundle wait.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling nkf
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/nkf.bundle nkf.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling openssl
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/openssl.bundle openssl_missing.o ossl.o ossl_asn1.o ossl_bio.o ossl_bn.o ossl_cipher.o ossl_config.o ossl_digest.o ossl_engine.o ossl_hmac.o ossl_ns_spki.o ossl_ocsp.o ossl_pkcs12.o ossl_pkcs5.o ossl_pkcs7.o ossl_pkey.o ossl_pkey_dh.o ossl_pkey_dsa.o ossl_pkey_ec.o ossl_pkey_rsa.o ossl_rand.o ossl_ssl.o ossl_ssl_session.o ossl_x509.o ossl_x509attr.o ossl_x509cert.o ossl_x509crl.o ossl_x509ext.o ossl_x509name.o ossl_x509req.o ossl_x509revoked.o ossl_x509store.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lssl -lcrypto -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling pty
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/pty.bundle pty.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lutil -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling racc/cparse
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../../.ext/i686-darwin9.8.0/racc/cparse.bundle cparse.o -L. -L../../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../../libruby.dylib, file is not of required architecture
compiling readline
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/readline.bundle readline.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lreadline -lncurses -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling sdbm
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/sdbm.bundle _sdbm.o init.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling socket
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/socket.bundle socket.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling stringio
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/stringio.bundle stringio.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling strscan
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/strscan.bundle strscan.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling syck
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/syck.bundle bytecode.o emitter.o gram.o handler.o implicit.o node.o rubyext.o syck.o token.o yaml2byte.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling syslog
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/syslog.bundle syslog.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling thread
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/thread.bundle thread.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
compiling tk
Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.
compiling tk/tkutil
compiling win32ole
compiling zlib
cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace -o ../../.ext/i686-darwin9.8.0/zlib.bundle zlib.o -L. -L../.. -L. -arch x86_64 -bind_at_load -lruby -lz -ldl -lobjc
ld warning: in ../../libruby.dylib, file is not of required architecture
making ruby
/usr/bin/gcc-4.2 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch x86_64 -bind_at_load main.o -lruby -ldl -lobjc -o ruby
ld warning: in ./libruby.dylib, file is not of required architecture
Undefined symbols:
"_ruby_options", referenced from:
_main in main.o
"_ruby_run", referenced from:
_main in main.o
"_ruby_init", referenced from:
_main in main.o
"_ruby_init_stack", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [ruby] Error 1
make: *** [all] Error 2
If you need any more info, let me know.
EDIT: I performed the following steps after reading this thread: make error when installing `ruby-1.8.7-p334` with `rvm` on Snow Leopard
rvm pkg install readline
rvm remove 1.8.7
rvm cleanup all
rvm install ruby-1.8.7-p302
This successfully installed the patch, indicating it is installed first time so any subsequent errors can be ignored. It did still error when compiling Ruby. As the make log file exceeds this post's character count capacity, you can view the contents of the second makefile here: http://pastebin.com/MTZjXBdF
Did not work with the latest release. However could get it to work by forcing it to use the rvm installed readline.
rvm install 1.8.7 -C –with-readline-dir=$rvm_path/usr
So complete steps are:
rvm pkg install readline
rvm remove 1.8.7
rvm cleanup all
rvm install 1.8.7 -C –with-readline-dir=$rvm_path/usr
Thanks to Andrew at http://anlek.com/2011/01/rvm-install-1-8-7-p330-fails/ for the pointer.
I just tested it with both linux and OSX, it seems to be fixed already:
rvm get head
rvm install 1.8.7-p302 --autolibs=3
Also consider upgrading to ruby-2.0.0 - the 1.8 tree will be no more maintained in few months.

Resources