I have followed the directions at https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit for installation on Windows 7. I have uninstalled Qt and reinstalled and tried to do this many times, and I can't get it to work.
I added to qmake.conf the line
QMAKE_LFLAGS = -static-libgcc -static-libstdc++
The other line in the directions for QMAKE_RCC was already there.
When I do this command in the directions...
C:\development\Ruby193\capybara-webkit>bundle exec rake build
I get errors - starting with:
c:/Qt/qt-4.8.5-x64-mingw/bin/qmake.exe -spec ../../../Qt/qt-4.8.5-x64-mingw/mksp
WARNING: (internal):1: Unescaped backslashes are deprecated.
cd src/ && c:/Qt/qt-4.8.5-x64-mingw/bin/qmake.exe c:/development/Ruby193/capybar
/mkspecs/win32-g++ CONFIG+\=test -o Makefile.webkit_server
WARNING: (internal):1: Unescaped backslashes are deprecated.
cd src/ && make -f Makefile.webkit_server
make[1]: Entering directory /c/development/Ruby193/capybara-webkit/src'
make -f Makefile.webkit_server.Debug
make[2]: Entering directory/c/development/Ruby193/capybara-webkit/src'
g++ -static-libgcc -static-libstdc++ -Wl,-subsystem,console -mthreads -o debug/w
x64-mingw/lib' -lQtWebKitd4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
g++.exe: unrecognized option '-static-libstdc++'
./build/BlockUrl.o: In function ZNK5QListI7QStringEixEi':
c:\development\Ruby193\capybara-webkit\src/../../../../Qt/qt-4.8.5-x64-mingw/inc
PKcS0_S0_i'
./build/SetUnknownUrlMode.o: In functionZN7QStringpLERKS_':
c:\development\Ruby193\capybara-webkit\src/../../../../Qt/qt-4.8.5-x64-mingw/inc
ppendERKS_'
...
ending with the following lines:
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x20): undefined reference to QObject::ev
entFilter(QObject*, QEvent*)'
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x24): undefined reference toQObject::ti
merEvent(QTimerEvent*)'
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x28): undefined reference to QObject::ch
ildEvent(QChildEvent*)'
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x2c): undefined reference toQObject::cu
stomEvent(QEvent*)'
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x30): undefined reference to QObject::co
nnectNotify(char const*)'
./build/moc_RequestHandler.o:moc_RequestHandler.cpp:(.rdata$_ZTV14RequestHandler[vtable for RequestHandler]+0x34): undefined reference toQObject::di
sconnectNotify(char const*)'
./build/moc_RequestHandler.o: In function ~RequestHandler':
c:\development\Ruby193\capybara-webkit\src/build/../RequestHandler.h:11: undefined reference to_imp___ZN7QObjectD2Ev'
./build/qrc_webkit_server.o: In function Z28qInitResources_webkit_serverv':
c:\development\Ruby193\capybara-webkit\src/debug/qrc_webkit_server.cpp:479: undefined reference to_imp___Z21qRegisterResourceDataiPKhS0_S0_'
./build/qrc_webkit_server.o: In function Z31qCleanupResources_webkit_serverv':
c:\development\Ruby193\capybara-webkit\src/debug/qrc_webkit_server.cpp:488: undefined reference to_imp___Z23qUnregisterResourceDataiPKhS0_S0_'
collect2: ld returned 1 exit status
make[2]: * [debug/webkit_server.exe] Error 1
make[2]: Leaving directory /c/development/Ruby193/capybara-webkit/src'
make[1]: *** [debug] Error 2
make[1]: Leaving directory/c/development/Ruby193/capybara-webkit/src'
make: * [sub-src-webkit_server-pro-make_default-ordered] Error 2
Command 'make' failed
Related
I'm trying to implement calling octave from C, as per the example shown in this answer Call GNU Octave functions in C?
I'm trying this in Nebeans on Linux.
I've created the files calloctave.cc, calloctave.h, main.c and myfunction.m as per the example. Pointed the links and includes to the correct places (in my case /usr/include/octave-5.2.0/octave/ and /usr/lib64/octave/5.2.0 ). I've chosen C++11 as the standard. In the code, there are no errors highlighted and it seems to find everything it needs, and nothing is highlighted as missing.
When I try to compile it, I just get a series of errors as follows....
cd '/home/arwel/NetBeansProjects/callOctave_new'
/bin/gmake -f Makefile CONF=Debug
"/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/arwel/NetBeansProjects/callOctave_new'
"/bin/gmake" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/libcallOctave_new.so
gmake[2]: Entering directory `/home/arwel/NetBeansProjects/callOctave_new'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/calloctave.o.d"
g++ -c -g -I/usr/include/octave-5.2.0/octave -include /usr/include/octave-5.2.0/octave/mex.h -std=c++11 -fPIC -MMD -MP -MF "build/Debug/GNU-Linux/calloctave.o.d" -o build/Debug/GNU-Linux/calloctave.o calloctave.cc
In file included from /usr/include/octave-5.2.0/octave/Cell.h:33:0,
from /usr/include/octave-5.2.0/octave/gtk-manager.h:32,
from /usr/include/octave-5.2.0/octave/interpreter.h:36,
from calloctave.cc:7:
/usr/include/octave-5.2.0/octave/ov.h:52:7: error: using typedef-name ‘mxArray’ after ‘class’
class mxArray;
^
In file included from <command-line>:0:0:
/usr/include/octave-5.2.0/octave/mex.h:55:14: note: ‘mxArray’ has a previous declaration here
typedef void mxArray;
^
In file included from /usr/include/octave-5.2.0/octave/ov.h:62:0,
from /usr/include/octave-5.2.0/octave/Cell.h:33,
from /usr/include/octave-5.2.0/octave/gtk-manager.h:32,
from /usr/include/octave-5.2.0/octave/interpreter.h:36,
from calloctave.cc:7:
/usr/include/octave-5.2.0/octave/ov-base.h:57:7: error: using typedef-name ‘mxArray’ after ‘class’
class mxArray;
^
In file included from <command-line>:0:0:
/usr/include/octave-5.2.0/octave/mex.h:55:14: note: ‘mxArray’ has a previous declaration here
typedef void mxArray;
^
calloctave.cc: In function ‘int mexCallOctave(int, mxArray**, int, mxArray**, const char*)’:
calloctave.cc:26:15: error: ‘mxArray’ is not a class, namespace, or enumeration
args(i) = mxArray::as_octave_value (argin[i]);
^
calloctave.cc:42:41: error: invalid use of ‘mxArray {aka void}’
argout[i] = new mxArray (retval(i));
^
calloctave.cc: In function ‘void free_arg_list(int, mxArray**)’:
calloctave.cc:56:29: warning: deleting ‘mxArray* {aka void*}’ is undefined [enabled by default]
delete arglist[i];
^
gmake[2]: *** [build/Debug/GNU-Linux/calloctave.o] Error 1
gmake[2]: Leaving directory `/home/arwel/NetBeansProjects/callOctave_new'
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory `/home/arwel/NetBeansProjects/callOctave_new'
gmake: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
It seems to be not understanding the mex interface in some way. I'm not very knowledgeable about C/C++, so am at a loss as to how to proceed here. What could be causing these errors and how might I resolve them?
Not a duplicate; Answers on various forums didn't fix the problem.
I am running GCC through commands and I am getting undefined references from SDL even though it appears like I linked SDL correctly, how do I stop from getting those undefined references ?
I do not get undefined references from mingw, just SDL.
This is my command: (all the libraries are being located by GCC from what I can tell)
gcc main.c ^
-o app.exe ^
-I "C:\__coding\tools\SDL2-2.0.10\x86_64-w64-mingw32\include\SDL2" ^
-L "C:\__coding\tools\MinGW\lib\" ^
-l "libmingw32.a" ^
-L "C:\__coding\tools\SDL2-2.0.10\x86_64-w64-mingw32\lib" ^
-l "libSDL2main.a" ^
-l "libSDL2.a"
This is the output:
C:...\main.c:(.text+0xe): undefined reference to 'SDL_Init'
C:...\main.c:(.text+0x13): undefined reference to 'SDL_Quit'
c:/__coding/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\...\AppData\Local\Temp\ccqsLSRk.o: bad reloc address 0x20 in section '.eh_frame'
c:/__coding/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
main.c includes SDL.h and just runs SDL_Init() and SDL_Quit().
I also get the classic undefined reference to "winmain" when I remove SDL_Init() and SDL_Quit().
Thanks alot.
Hi I've never written a makefile before, but I tried my hand at it with my fortran90 final project and the makefile seems to have delete my main program. here's my makefile
# Sample makefile for several modules
#
FC = gfortran
final.x: subs.o func.o maina.o
gfortran -o final.x subs.o func.o maina.o
subs.o: subs.f90
gfortran -c subs.f90
func.o: func.f90
gfortran -c func.f90
maina.o: maina.f90
gfortran -c maina.f90
after running this, my maina.f90 was deleted and the I did not have a copy. this was what it showed when it was running. (The first output is when I ran it and found an error in subs, and after fixing these errors, I got the second output)
$ make
gfortran -o final.x subs.o func.o maina.o
subs.o: In function `__subs_MOD_gauss':
subs.f90:(.text+0x350): undefined reference to `f_'
subs.f90:(.text+0x366): undefined reference to `f_'
subs.o: In function `__subs_MOD_simp':
subs.f90:(.text+0x434): undefined reference to `f_'
subs.f90:(.text+0x4a2): undefined reference to `f_'
subs.f90:(.text+0x51b): undefined reference to `f_'
subs.o:subs.f90:(.text+0x571): more undefined references to `f_' follow
collect2: ld returned 1 exit status
make: *** [final.x] Error 1
$ make
gfortran -c subs.f90
gfortran -o final.x subs.o func.o maina.o
does anyone know why this file deleted my maina.f90, or (though it's probably unlikely) how to get my work back?
EDIT- I should add that I do not have admin or sudo privileges on this computer
This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 4 years ago.
I am trying to compile a Fortran 90 code that uses HDF5. For that purpose, I am using the following Makefile:
# Location of HDF5 binaries (with include/ and lib/ underneath)
HDF5 = /fs/posgrado16/other0/guido/libraries/hdf5/serial
# Compiler
FC = gfortran
# ------ No machine-specific paths/variables after this -----
FORTRANLIB=-I$(HDF5)/include $(HDF5)/lib/libhdf5_fortran.a
FSOURCE = h5_crtgrpar.f90
OBJECTS = $(FSOURCE:.f90=.o)
EXECUTABLE = $(FSOURCE:.f90=.exe)
LIBSHDF = $(FORTRANLIB) $(HDF5)/lib/libhdf5.a
all:$(EXECUTABLE)
$(EXECUTABLE):$(OBJECTS)
$(FC) -o $# $^ $(LIBSHDF)
$(OBJECTS):$(FSOURCE)
$(FC) -c $# $< $(LIBSHDF)
.PHONY : clean
clean:
rm -f $(FSOURCE) $(OBJECTS) *.h5
But, I get the following error:
$ make -f Makefilef
gfortran -o h5_crtgrpar.exe h5_crtgrpar.o -I/fs/posgrado16/other0/guido /libraries/hdf5/serial/include /fs/posgrado16/other0/guido/libraries/hdf5/serial/lib/libhdf5_fortran.a /fs/posgrado16/other0/guido/libraries /hdf5/serial/lib/libhdf5.a
/fs/posgrado16/other0/guido/libraries/hdf5/serial/lib/libhdf5.a(H5PL.o): In function `H5PL_term_interface':
H5PL.c:(.text+0x205): undefined reference to `dlclose'
/fs/posgrado16/other0/guido/libraries/hdf5/serial/lib/libhdf5.a(H5PL.o): In function `H5PL_load':
H5PL.c:(.text+0x477): undefined reference to `dlsym'
H5PL.c:(.text+0x5be): undefined reference to `dlopen'
H5PL.c:(.text+0x5d7): undefined reference to `dlsym'
H5PL.c:(.text+0x704): undefined reference to `dlclose'
H5PL.c:(.text+0x789): undefined reference to `dlerror'
H5PL.c:(.text+0x960): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [h5_crtgrpar.exe] Error 1
I have no idea what the error is. Probably, there is something wrong with my Makefile.
To compile Fortran code with HDF5 enabled, you can replace
FC = gfortran
by
FC = h5fc
and skip all the hdf5 flags, as the h5fc wrapper will take care of those.
If you have some specific reason of calling the compiler by its name, you can learn about what flags are needed by calling
h5fc -show
that will show you what flags are added to the compiler.
On my computer (linux with gfortran), the result is:
gfortran -g -O2 -fstack-protector-strong -I/usr/include/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5hl_fortran.a /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.a /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_fortran.a /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a -Wl,-z,relro -lpthread -lz -ldl -lm -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/serial
Often you can get by with less flags than that, which you can find with some experimentation.
Given the error message you report, you lack the -ldl flags that enables linking of the dynamic linking library, see for isntance this other SO question.
I followed these instructions. Download lmbench3.tar.gz from lmbench3
and Unpack LMbench to create a tree like so:
lmbench/
Results/
doc/
scripts/
src/
And Go to the lmbench directory, and type make results see
But the result is wrong:
7 warnings generated.
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_uint64_t=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -c getopt.c -o ../bin/i686-apple-darwin15.6.0/getopt.o
gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_uint64_t=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -c lib_sched.c -o ../bin/i686-apple-darwin15.6.0/lib_sched.o
lib_sched.c:94:3: error: non-void function 'handle_scheduler' should return a
value [-Wreturn-type]
return;
^
1 error generated.
make[2]: *** [../bin/i686-apple-darwin15.6.0/lib_sched.o] Error 1
make[1]: *** [lmbench] Error 2
make: *** [build] Error 2
How to solve it?
You can change the statement
return;
into
return 0;
at line 94 of lib_sched.c
Then this file should compile without this error.