I am new to gtk+ and I'm trying to put a window on the screen using gtk3. My source file is win.c and I have tried to compile it using
$ gcc win.c $(pkg-config --cflags --libs gtk+-3.0) -o win.o
but what I get is:
/lib64/libEGL.so.1: undefined reference to `wl_display_dispatch_queue_pending'
collect2: error: ld returned 1 exit status
what should I do?
You can do the following command :
yum update libwayland*
wl_display_dispatch_queue_pending seems related to Wayland, the protocol implemented by successors of the Xorg server. The question is: why are you building for Wayland ?
Related
Environment
$ lsb_release -a
Description: Ubuntu 20.04.2 LTS
$gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Problem
link error happens depending on the position of input file.
NG
$gcc -lsndfile -o snd-003 snd-003.c
/usr/bin/ld: /tmp/ccMmdgxh.o: in function `main':
snd-003.c:(.text+0x5c): undefined reference to `sf_open'
/usr/bin/ld: snd-003.c:(.text+0x88): undefined reference to `sf_readf_short'
/usr/bin/ld: snd-003.c:(.text+0xc4): undefined reference to `sf_close'
collect2: error: ld returned 1 exit status
OK
If you change the argument position of input file, then link error does not happen.
$gcc snd-003.c -lsndfile -o snd-003
Other info
snd-003.c is uploaded below (just FYI).
https://file.io/PA4K22CzXwsi
this problem happens on other gcc version
gcc 8.4.0
gcc 7.5.0
this error happens on other libraries too (e.x. libssl).
there is no this problem on other machines.
deiban 10.9 (gcc 8.3.0)
debian 8.3 (gcc 4.9.2)
similar problem reported long time ago, but it's not solved.
strange g++ linking behavior depending on arguments order
Question
Does anyone have some clue on what's wrong with this ? gcc ? environment ?
I want to know the root cause of this behavior.
Any comments are really appreciated.
I guess this is the expected behavior (https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html):
The linker will search an archive only once, at the location where it is specified on the command line. If the archive defines a symbol which was undefined in some object which appeared before the archive on the command line, the linker will include the appropriate file(s) from the archive. However, an undefined symbol in an object appearing later on the command line will not cause the linker to search the archive again. See the -( option for a way to force the linker to search archives multiple times.
I have been following the instructions to install CalculiX and its dependencies as best as I could from the wiki page https://github.com/precice/calculix-adapter/wiki/Installation-instructions-for-CalculiX
I have already installed all the dependencies.
In the installation when I say make I get the following error:
gfortran -fopenmp -Wall -O3 -o bin/ccx_preCICE bin/ccx_2.15.o bin/ccx_2.15.a /home/prasad/SPOOLES.2.2//spooles.a -L/usr/local/lib -lprecice -lstdc++ -L/home/prasad/yaml-cpp-yaml-cpp-0.6.2//build -lyaml-cpp /home/prasad/ARPACK//libarpack_INTEL.a -lpthread -lm -lc
/home/prasad/ARPACK//libarpack_INTEL.a(second.o): In function `second_':
second.f:(.text+0x14): undefined reference to `etime_'
collect2: error: ld returned 1 exit status
Makefile:101: recipe for target 'bin/ccx_preCICE' failed
make: *** [bin/ccx_preCICE] Error 1
I tried changing the line 24 in ARPACK/UTIL/second.f to * EXTERNAL ETIME, but I am still getting the same error.
Can anyone tell me how to fix it?
Thank you in advance for the help.
Edit line 24 in ARPACK/UTIL/second.f
Append * to get
* EXTERNAL ETIME
If you get this error when you are building the adapter for CalculiX, go to ARPACK
make lib
Go back to the calculiX-adapter-master directory or the directory from where you were building CalculiX and its adapter
make clean
make
For detailed guide please check preCICE wiki for CalculiX adapter
I m trying to install Aqua3d "obinet.engr.uconn.edu/wiki/index.php/Aqua-3D_dev_manual`", for which I need to first make the file provided with the package, When I try to do so by using the command on terminal:
$ make -f Makefile.txt
I am getting the following output:
g++ wx-config --libs --cxxflags --gl-libs -lglut -lGLU -lGL -o aqua3d Aqua3D.o ControlPanel.o EnvironmentPanel.o FileChooser.o InformationPanel.o MainFrame.o PlaybackPanel.o PreferenceWindow.o ViewFileHandler.o NodeAttributeDialog.o Event.o AnnotationEvent.o DequeueEvent.o DropEvent.o EnqueueEvent.o HopEvent.o HopSignal.o NodeEvent.o ReceiveEvent.o WorldEvent.o DataManager.o Environment.o EventManager.o Node.o Parser.o vmath.o trackball.o
Aqua3D.o: In function Aqua3D::OnInit()':
Aqua3D.cpp:(.text+0x35): undefined reference towxStandardPathsBase::Get()'
Aqua3D.cpp:(.text+0x7a): undefined reference to wxString::Bef>
.
.
.
Parser.cpp:(.text+0x1e4d): undefined reference towxLogError(wchar_t const*, ...)'
collect2: error: ld returned 1 exit status
make: * [aqua3d] Error 1**
Kindly guide me how to resolve this problem?
FYI, I've already installed freeglut3-dev, libwxgtk2.8-dev, libgtk2.0-dev.
Aqua3d can be compiled with g++-4.4 : sudo apt-get install g++-4.4
Example, edited Makefile https://drive.google.com/file/d/0B7S255p3kFXNWC13UXZFZHJ6OUU/view?usp=sharing
I have been writing some python extension modules with cython. The extensions I've written build and work well. Then, I wanted to use typed memoryviews, when accessing my numpy arrays, as they seem to have several advantages http://docs.cython.org/src/userguide/memoryviews.html
However, as soon as I use a memoryview in my cython code I will get an error when building the extension. For example, if I add this test line:
cdef double[:, ::1] X = np.zeros((100, 100))
to an existing, working cython extension. I will get the following errors:
C:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\image_box.o build\temp.win32-2.7\Release\image_box.def -Lc:\python27\libs -Lc:\python27\PCbuild -lp
ython27 -lmsvcr90 -o x:\ARframework\python\image_ops\image_box.pyd
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0xe23): undefined reference to `___sync_fetch_and_add_4'
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0x3318): undefined reference to `___sync_fetch_and_add_4'
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0x4c81): undefined reference to `___sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0x4d37): undefined reference to `___sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0x10767): undefined reference to `___sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\image_box.o:image_box.c:(.text+0x10793): undefined reference to `___sync_fetch_and_sub_4'
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
I've tried to add -march=i486 to the gcc line, as suggested in this post:
undefined reference to sync_fetch_and_add_4
but that didn't solve the problem. For that matter, I also tried -march=i586 and -march=pentium without success.
Any idea what's going on here?
My platform is Windows 7, mingw version is 4.70, Cython version is 0.17.1
Thanks
I found a solution.
Actually, the gcc flag -march=i486 does solve the problem! However, when I tested it in the console I just applied it to the gcc line for the link step (that's where I got the errors) and as it didn't solve the problem I thought it just didn't work.
In fact, I need to use -march=i486 both in the compile and link steps, then there is no errors anymore.
As to how to include these flags when I build the extension, I have tried to add
import os
os.environ['LDFLAGS'] = '-march=i486'
os.environ['CFLAGS'] = '-march=i486'
to the setup.py but it didn't seem to work.
So I have modified the c:\python27\Lib\distutils\cygwinccompiler.py to include these flags in the compile and link steps. Not sure if this is very elegant way of setting these flags. Any alternatives are welcome!
I tried to re-compile vim with ruby support because I noticed that vim was still using 1.8.7 (which is the default ruby version on Snow Leopard). Ruby 1.9.2 is installed via rvm.
When compiling with
./configure --enable-rubyinterp --enable-gui=no --disable-nls --enable-cscope --prefix=/Users/madhatter
I get the following error from make:
ld: library not found for -lruby.1.9.1
collect2: ld returned 1 exit status
make[1]: *** [vim] Error 1
make: *** [first] Error 2
I then cloned the actual repository from googlecode and tried to build that. There were no errors in make, but starting vim resulted in the following error:
dyld: Symbol not found: _environ
Referenced from: /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.1.9.1.dylib
Expected in: flat namespace
in /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.1.9.1.dylib
[1] 41782 trace trap vim
Last thing I tried was adding some ruby information to the config.mk file
RUBY = /Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
RUBY_SRC = if_ruby.c
RUBY_OBJ = objects/if_ruby.o
RUBY_PRO = if_ruby.pro
RUBY_CFLAGS = -I/Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I/Users/madhatter/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin10.8.0 -DRUBY_VERSION=19
RUBY_LIBS = -lruby.1.9.1 -lpthread -ldl -lobjc
Any other ideas what might work?
see Trying to compile vim on OS X? for an answer. Basically the answer is that you can't right now without fixing Vim.
This is what I'm using for vim + python
./configure --with-features=BIG --enable-pythoninterp=yes --enable-multibyte=yes --enable-cscope=yes
Looks like you're missing
--enable-rubyinterp=yes