building from latest source as well older pspp is unable to compile after upgrade to ubuntu 21.04 from, 20 - undefined

building from latest source as well older pspp is unable to compile after upgrade to ubuntu 21.04 from, 20
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_uri_split_network'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_uri_is_valid'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_memdup2'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_uri_join'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_uri_split_with_user'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_spawn_async_with_pipes_and_fds'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_file_set_contents_full'

problem solved
sudo apt-get purge --auto-remove libgio*
cd /usr/lib/x86_64-linux-gnu
sudo rm libgio*
sudo apt-get install libgio*

Related

how to install lex and yacc in fedora?

I don't know how to install the lex and yacc in the fedora 24. I installed it in the ubuntu 16. Using following commands:
sudo apt-get update
sudo apt-get install flex
sudo apt-get install bison
Is there any reason why
dnf install flex-devel bison-devel
would not do the job?
Solution for those who encountered the below error:
/usr/bin/ld: cannot find -ll
collect2: error: ld returned 1 exit status
OR
/usr/bin/ld: cannot find -lfl
collect2: error: ld returned 1 exit status
step 1:
dnf install flex bison
step 2:
dnf install flex-devel bison-devel
then run it. I had the same issue, installing flex-devel solved it.
Previous answer didn't do the job, but this did:
sudo dnf install flex-devel bison-devel byacc

Error installing json: Failed to build gem native extension

Spent some time figuring this one out this:
gem install json
Resulted in this error:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby/bin/ruby -r ./siteconf20150611-1112-jqgxzj.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1
make failed, exit code 2
The important line here is "cannot find -lgmp".
Solution:
sudo apt-get install libgmp-dev

mysql udf error - can't install in ubuntu 12.04 64 bit

I have trouble installing the mysql udf (https://github.com/mysqludf/lib_mysqludf_sys). Here's what I'm getting:
Compiling the MySQL UDF
gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib/lib_mysqludf_sys.so
/usr/bin/ld: /tmp/ccw6HRtN.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp/ccw6HRtN.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [install] Error 1
ERROR: You need libmysqlclient development software installed
to be able to compile this UDF, on Debian/Ubuntu just run:
apt-get install libmysqlclient15-dev
Any ideas? TIA
UPDATED:
I have already the libmysqlclient15-dev installed.
Try to recompile with -fPIC flag. It obviously hints at it:
/usr/bin/ld: /tmp/ccw6HRtN.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
I know this is an old question, however I've just had this issue using Ubuntu 16.
I solved changing the Makefile in the following way, as explained in a GitHub issue:
LIBDIR=/usr/lib/mysql/plugin
install:
gcc -DMYSQL_DYNAMIC_PLUGIN -fPIC -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o $(LIBDIR)/lib_mysqludf_sys.so

Rails 3.2.3 MySQL 5.5.1 Mysql2 gem install fails with ld incompatibilities

I have a clean build system as follows
Ubuntu 11.04
Rvm 1.13.5
Ruby 1.9.3p194
Rails 3.2.3
Gem 1.8.24
MySql 5.5.24-1 (installed in /usr/local)
I am trying to install the mysql2 gem (0.3.11) and getting the following problem:
pal#smurf01:~$ sudo gem install mysql2
[sudo] password for pal:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
compiling client.c
client.c: In function 'rb_raise_mysql2_error':
client.c:98:3: warning: ISO C90 forbids mixed declarations and code
client.c: In function 'rb_mysql_client_socket':
client.c:590:3: warning: ISO C90 forbids mixed declarations and code
compiling mysql2_ext.c
compiling result.c
linking shared-object mysql2/mysql2.so
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.a when searching for -lmysqlclient_r
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
pal#smurf01:~$
First question: Has anyone got Rails mysql2 running with MySql 5.5.1 on Ubuntu? I have it running on another system with 5.1. The gem description is vague on supported MySql versions.
Second question: Has anyone encountered this problem? I± have battled various library issues with the mysql2 gem over the passed year or so but this seems to be different.
Any assistance is gratefully recieved.
BTW: Reverting back to MySql 5.1 is a valid solution!
Regards
Peter
Or just apt-get install libmysqlclient-dev and then gem install mysql2
So the problem appears to have been a missing library and some links. Doing the following solved the issue.
Get the new and install the libmysqlclient-dev deb package kindly provided by Nathan Rennie Waldock
wget http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu/pool/main/m/mysql-5.5/libmysqlclient-dev_5.5.24-1~ppa1~natty_amd64.deb./;l
dpkg -i libmysqlclient-dev_5.5.24-1~ppa1~natty_amd64.deb
Then create some links that mysql2 needs as it can't seem to follow the mysql path
cd /usr/lib/
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.a .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so.18 .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so.18.0.0 .
Now happily install the mysql2 gem
sudo gem install mysql2
Fetching: mysql2-0.3.11.gem (100%)
Building native extensions. This could take a while...
Successfully installed mysql2-0.3.11
1 gem installed
Installing ri documentation for mysq2l-0.3.11...
Installing RDoc documentation for mysql2-0.3.11...
Had the same issue in Ubuntu 12.04 also using the ppa mentioned in the accepted answer.
But also there was no libmysqlclient file on my system with _r in the name.
Googling around I found out that package builders have started to drop the _r suffix from the files, so that might have happened between 11.10 and 12.04.
Also the paths were a bit different to the once mentioned so these are the symlinks that I had to create:
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.a ./libmysqlclient_r.a
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so ./libmysqlclient_r.so
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 ./libmysqlclient_r.so.18
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0 ./libmysqlclient_r.so.18.0.0
I had this problem as well...
I did dpkg -r mysql-devel as when I was trying to do apt-get install libmysqlclient-dev I got an error saying:
Unpacking libmysqlclient-dev (from .../libmysqlclient-dev_5.5.24-0ubuntu0.12.04.1_i386.deb) ... dpkg:
error processing
/var/cache/apt/archives/libmysqlclient-dev_5.5.24-0ubuntu0.12.04.1_i386.deb
(--unpack): trying to overwrite '/usr/bin/mysql_config', which is
also in package mysql-devel 5.5.28-2
After doing this, gem install mysql2 worked! yay :)

Rails / Snow Leopard Mysql 64-bit question

Hey all, I'm trying to install 64-bit MySQL on Snow Leopard for a rails app.
I've installed it from the dmg and I can get to mysql fine from the command line. Based on various blog posts as well as the other topics here on Stack, I shut down mysql, uninstall the mysql gem, and then try to update the gem with the following:
sudo env ARCHFLAGS='-arch x86_64' gem install --verbose --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
That produces the following:
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
Installing gem mysql-2.8.1
Downloading gem mysql-2.8.1.gem
GET 302 Found: http://gems.rubyforge.org/gems/mysql-2.8.1.gem
GET 200 OK: http://s3.amazonaws.com/gemcutter_production/gems/mysql-2.8.1.gem
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/COPYING
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/COPYING.ja
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/History.txt
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/Manifest.txt
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/README.txt
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/Rakefile
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/extconf.rb
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/mysql.c
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/extra/README.html
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/extra/README_ja.html
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/extra/tommy.css
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql.rb
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/tasks/gem.rake
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/tasks/native.rake
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/tasks/vendor_mysql.rake
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/test/test_mysql.rb
Building native extensions. This could take a while...
/usr/local/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
creating Makefile
make
gcc -I. -I. -I/usr/local/lib/ruby/1.8/universal-darwin8.0 -I. -DHAVE_MYSQL_H -I/usr/local/mysql/include -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -fno-common -g -O2 -fno-common -pipe -fno-common -arch i386 -c mysql.c
cc -dynamic -bundle -undefined suppress -flat_namespace -arch i386 -L"/usr/local/lib" -o mysql_api.bundle mysql.o -lruby -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc -lpthread -ldl -lobjc
ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file is not of required architecture
ld: warning: in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
make install
/usr/bin/install -c -m 0755 mysql_api.bundle /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib
Successfully installed mysql-2.8.1
1 gem installed
Those two warnings at the end seem ominous. I then go to my rails app and run
rake db:migrate
And get:
dyld: NSLinkModule() error
dyld: Symbol not found: _mysql_affected_rows
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Expected in: flat namespace
in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Trace/BPT trap
And that's as far as I'm able to get. I've tried installing MySQL via the dmg and via macports and I seem to run into this error in both cases.
I'm kind of a noob when it comes to rails; any light anyone can shed would be wildly appreciated. Thanks!
--- EDIT ---
In response to John's (and khelll's) answers below:
When I do the first command that John specified, I get:
No definition for next_result
No definition for field_name
No definition for field_table
There's about 40 lines of this. I assumed this was because of the documentation. But when I do rake db:migrate I get:
dyld: NSLinkModule() error
dyld: Symbol not found: _mysql_affected_rows
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Expected in: flat namespace
in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Trace/BPT trap
Using the ARCHFLAGS command produces the error I specified earlier.
--- SECOND EDIT ---
I should add that I did not install from source. After peeking at the Hivelogic instructions again, I went down this route.
When I tried to run:
./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase
I got:
config.status: creating zlib/Makefile
dyld: Library not loaded: /opt/local/lib/libintl.8.dylib
Referenced from: /opt/local/bin/gawk
Reason: no suitable image found. Did find:
/opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture
./config.status: line 1782: 69228 Done(141) eval sed ç"ç$ac_sed_extraç" "$ac_file_inputs"
69229 Trace/BPT trap
So I did:
sudo port deactivate gettext
sudo port activate gettext #0.17_3
However, after following all the steps, reinstalling the gem, upon rake db:migrate I still get:
dyld: NSLinkModule() error
dyld: Symbol not found: _mysql_affected_rows
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Expected in: flat namespace
in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
Trace/BPT trap
---- THIRD EDIT ----
Okay - I believe what's happening here is that, even though I'm specifying the 64 bit gem above, it's installing the 32 bit version. I do:
file /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
And get:
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle: Mach-O bundle i386
So it would seem I keep installing the 32 bit version
I installed it from source following these instructions on Hivelogic and it works great. Then I installed the MySQL RubyGem using:
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql