I am looking to build lsqlite3 0.9.4 for lua 5.3.1 on Windows 10.
However I am not entirely sure how to go about it.
There is a rockspec file but I am not sure if I should be trying to do it through that(because by default I think luarocks is configured for 5.1) or manually with Visual Studio Developer console.
I unfortunately do not have much knowledge on what I should be doing.
From my guess googling/trial and error here is what I have done, and I have no idea if this is correct so forgive me.
cl /nologo /MD /O2 -c -Folsqlite3.obj -I"C:/Lua/5.3.1/include" lsqlite3.c -Dluaopen_lsqlite3=luaopen_lsqlite3complete
(Basically got this command from luarocks when it failed to work)
And then I did this:
LINK.EXE /DLL /OUT:lsqlite3.dll lsqlite3.obj
Which gave me a bunch of unresolved external sqlite3 symbol errors which I kind of expected, I just am not sure where to include in sqlite3..
Any advice on how to properly do this?
First. It ships with sqilte sourece itself.
But luarocks has 2 modules. One require separate SQLite library.
And one build sqlite and lsqlite in single file. So it has no external deps.
Also I think lsqlite3 has bug on Windwos. It provide access to sqlite3_temp_directory. But this not defined on Windows where host application should define it. So lsqlite just try use ifdef to ignore this. But it test WIN32 macro which not defined on MS compiler. So you have 2 ways.
1. Edit rockspec/make file and define WIN32
2. Edit source and use _WIN32 instead
This is output from LuaRocks make command
d:\tmp\lsqlite3_fsl09x>luarocks make lsqlite3-0.9.4-0.rockspec
cl /nologo /MD /O2 -c -Folsqlite3.obj -Ic:\luarocks\x86\5.1\include\ lsqlite3.c -DLSQLITE_VERSION="0.9.4" -Dluaopen_lsqlite3=luaopen_lsqlite3complete lsqlite3.c
cl /nologo /MD /O2 -c -Fosqlite3.obj -Ic:\luarocks\x86\5.1\include\ sqlite3.c -DLSQLITE_VERSION="0.9.4" -Dluaopen_lsqlite3=luaopen_lsqlite3complete sqlite3.c
link -dll -def:lsqlite3complete.def -out:lsqlite3complete.dll c:\luarocks\x86\5.1\lib\lua51.lib lsqlite3.obj sqlite3.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library lsqlite3complete.lib and object lsqlite3complete.exp
cl /nologo /MD /O2 -c -Folsqlite3.obj -Ic:\luarocks\x86\5.1\include\ lsqlite3.c -DLSQLITE_VERSION="0.9.4" -Ic:/luarocks/x86/external/include
lsqlite3.c
link -dll -def:lsqlite3.def -out:lsqlite3.dll c:\luarocks\x86\5.1\lib\/lua51.lib lsqlite3.obj -libpath:c:/luarocks/x86/external/lib sqlite3.lib
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library lsqlite3.lib and object lsqlite3.exp
lsqlite3 0.9.4-0 is now installed in c:\luarocks\x86\5.1\systree (license: MIT/X11)
But if you have no separate SQLite libray you just can remove one module form rockspec and use only one (and also rename module).
build = {
type = "builtin",
modules = {
lsqlite3 = {
sources = { "lsqlite3.c", "sqlite3.c" },
defines = {'LSQLITE_VERSION="0.9.4"'}
}
},
copy_directories = { 'doc', 'examples' }
}
This is output for LuaRocks make command
d:\tmp\lsqlite3_fsl09x>luarocks make lsqlite3-0.9.4-0.rockspec
cl /nologo /MD /O2 -c -Folsqlite3.obj -Ic:\luarocks\x86\5.1\include\ lsqlite3.c -DLSQLITE_VERSION="0.9.4" lsqlite3.c
cl /nologo /MD /O2 -c -Fosqlite3.obj -Ic:\luarocks\x86\5.1\include\ sqlite3.c -DLSQLITE_VERSION="0.9.4" sqlite3.c
link -dll -def:lsqlite3.def -out:lsqlite3.dll c:\luarocks\x86\5.1\lib\/lua51.lib lsqlite3.obj sqlite3.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library lsqlite3.lib and object lsqlite3.exp
lsqlite3 0.9.4-0 is now installed in c:\luarocks\x86\5.1\systree (license: MIT/X11)
Related
At the linking stage, I am getting an error of the form:
Undefined symbols for architecture x86_64:
"_mpi_allreduce", referenced from:
_pcnaup2 in libparpack.a(pcnaup2.o)
_pslamch in libparpack.a(pslamch.o)
_pcgetv0 in libparpack.a(pcgetv0.o)
_pcnaitr in libparpack.a(pcnaitr.o)
_pscnorm2 in libparpack.a(pscnorm2.o)
"_mpi_comm_rank", referenced from:
_pcnaupd in libparpack.a(pcnaupd.o)
_pcmout in libparpack.a(pcmout.o)
_pcvout in libparpack.a(pcvout.o)
_pivout in libparpack.a(pivout.o)
_pcgetv0 in libparpack.a(pcgetv0.o)
_psvout in libparpack.a(psvout.o)
when I am trying to link with mpifort, so that the command that is being run looks like
mpifort -L(lots of libraries) -l(lots of libraries) -o qlua qlua.o
though I am confused; because I was under the impression that using the wrapper mpifort should handle all the linking to the mpi library for me, so I'm not too sure what steps I should take to debug such an error. For completeness, when I run mpifort -v the output is:
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/10.2.0_2 --libdir=/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0_2' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Homebrew GCC 10.2.0_2)
I pulled down the qtpdf repository to check out and play with from here:
http://code.qt.io/cgit/qt-labs/qtpdf.git
As soon as I open the qtpdf.pro file, I get the following general messages:
Cannot read C:/.../build-qpdf-Desktop_Qt_5_10_0_MinGW_32bit-Debug/src/lib/pdfium.pri: No such file or directory
Cannot read C:/.../build-qpdf-Desktop_Qt_5_10_0_MinGW_32bit-Debug/src/lib/freetype.pri: No such file or directory
Project MESSAGE: perl -w C:\Qt\5.10.0\mingw53_32\bin\syncqt.pl -module QtPdf -version 5.9.0 -outdir "C:/.../build-qpdf-Desktop_Qt_5_10_0_MinGW_32bit-Debug" C:/.../qtpdf
Project MESSAGE: perl -w C:\Qt\5.10.0\mingw53_32\bin\syncqt.pl -module QtPdfWidgets -version 5.9.0 -outdir "C:/.../build-qpdf-Desktop_Qt_5_10_0_MinGW_32bit-Debug" C:/.../qtpdf
Project ERROR: Unknown module(s) in QT: pdfwidgets
Project ERROR: Unknown module(s) in QT: pdf
Also when running "rebuild all" I get the following error message:
16:15:33: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" qmake_all
"Some of the required modules (!qnx:!uikit:!winphone:!winrt:!win32-g++:!integrity) are not available."
"Skipped."
I've narrowed this down to !win32-g++ - If I remove that, it won't throw that error, but I don't understand what exactly this error means - I have googled around a lot but couldn't find anything that seemed reminiscent of this particular problem.
I managed to build qtpdf with mingw provided with Qt5.11.2.
Comment out "requires(!qnx:!uikit:!winphone:!winrt:!win32-g++:!integrity)" from pdf.pro
Apply the patch found here : https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-pdfium-git/pdfium-2729.patch (link dead in 2021, no backup sorry)
Add -luuid after "win32: LIBS_PRIVATE += -ladvapi32 -lgdi32 -luser32" in lib.pro
I don't know why, probably because I am not an expert, but mingw doesn't generate correctly the folder "include". As a workaround I use the one generated under linux. For some reason, mingw generate only QPdfDepends and QPdfWidgetsDepends, none of the needed headers are generated. I didn't dig because I am lazy.
Hope it helps !
# Upstream PDFium has not been ported to various platforms yet.
requires(!qnx:!uikit:!winphone:!winrt:!win32-g++:!integrity)
The module is not working on win32-g++ (mingw32).
For a dated embedded project I try to crosscompile Qt 4.7.4 on a current Ubuntu 16.04 x86_64 system with multiarch setup (amd64 + i386).
The crosscompilation was once set up for Ubuntu 12.04 x86, and it works well there. Compiling it on the new system for host debugging (host and target platform being set to x86/i386/32 bit) worked well, too. However, when I try to crosscompile it for the target system (arm) with the host set to i386 uic segfaults while building the QtGui lib.
The following relevant flags are used to configure Qt for the target system:
-host-arch i386 -platform qws/linux-x86-g++
-embedded arm -xplatform qws/linux-gnueabi-arm-mucross-g++
Furthermore mkspecs/qws/linux-x86-g++/qmake.conf has been patched to include some compiler flags that seem necessary to get compilation and linking right:
QT_ARCH = I386
QMAKE_CFLAGS += -m32
QMAKE_CXXFLAGS += -m32
QMAKE_LFLAGS += -m32
This is the call that fails:
/<project>/qt-target/bin/uic /<project>/qt-everywhere-opensource-src-4.7.4/src/gui/dialogs/qpagesetupwidget.ui -o .uic/release-shared-emb-arm/ui_qpagesetupwidget.h
I can reproduce the segfault manually and debug it. strace doesn't show anything obvious, the correct i386 libs are being loaded. Here's the first lines of the gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
__GI___fesetenv (envp=0xffffbbd4) at ../sysdeps/i386/fpu/fesetenv.c:116
116 ../sysdeps/i386/fpu/fesetenv.c: Datei oder Verzeichnis nicht gefunden.
(gdb) backtrace
#0 __GI___fesetenv (envp=0xffffbbd4) at ../sysdeps/i386/fpu/fesetenv.c:116
#1 0x080fa7de in qdtoa (d=9999.9899999999998, mode=2, ndigits=6,
decpt=0xffffbce8, sign=0xffffbcec, rve=0xffffbcf4, resultp=0xffffbcf8)
at /<project>/qt-everywhere-opensource-src-4.7.4/src/corelib/tools/qlocale.cpp:6655
#2 0x080fc230 in QLocalePrivate::doubleToString (
this=0x8181160 <locale_data>, d=9999.9899999999998, precision=2,
form=<optimized out>, width=0, flags=<optimized out>)
at /<project>/qt-everywhere-opensource-src-4.7.4/src/corelib/tools/qlocale.cpp:4012
#3 0x0811da6f in QString::setNum (this=0xffffbf78, n=9999.9899999999998,
f=<optimized out>, prec=6)
at /<project>/qt-everywhere-opensource-src-4.7.4/src/corelib/tools/qstring.cpp:5930
#4 0x0811ddca in QString::number (n=9999.9899999999998, f=103 'g', prec=6)
at /<project>/qt-everywhere-opensource-src-4.7.4/src/corelib/tools/qstring.cpp:6034
Some investigation brought me to a glibc bug in fesetenv() which was fixed in glibc 2.23, but since this is already installed (libc6 2.23-0ubuntu3), I didn't get any further here. The faulting line 116 has been introduced by that fix, but lacking knowledge of the internals I'm not able to point out the cause of the segfault:
__asm__ ("ldmxcsr %0" : : "m" (mxcsr));
Furthermore there are some old, closed or unresolved Qt bug reports regarding the bootstrap build (which includes uic), but these didn't give me any useful hints either.
Who can give a pointer what I can try to find the cause and work around or fix this issue?
The reason for this problem was that additional, target specific include and lib dirs were provided to the configure script using the -I and -L options. These were used for the bootstrap build, too, which didn't matter much on the old system where the headers of host and target where apparently close enough to each other.
Once moved into the target mkspec file and added to QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS the build process works fine.
I just built standard core 15.09a on linux and run sample apps basic_client.
This one built by scons.
bin/samples/basic_client works fine.
However, I built cpp/samples/basic/basic_client with Makefile.
It does not work. It shows an error
"0.232 ****** ERROR ALLJOYN external ...e/src/BusAttachment.cc:560 | BusAttachment::Connect failed: ER_OS_ERROR
BusAttachment::Connect('') failed.".
So, I launched the bin/allhoyn-daemon, then no error occurred.
What is difference between scon and Makefile version?
Additionally, where can I get the information of application under the bin directory?
I searched the web-site of AllSeen and couldn't find any info.
As i know, the error that you got when build with Makefile happens because basic_client hasn't alljoyn router inside, with scons it runs fine because it compiles with BR=on and some flags:
-lajrouter -lBundledRouter.o -lssl -lcrypto
For more infomation, visit: here
I am using Qt 4 (the latest GPL version released by Nokia)
I download Qt Property Browser from doc.trolltech.com/solutions/4/qtpropertybrowser/index.html
I am using VC++ 2008, with Qt Visual Studio Add-In Installed.
I try to build simple project, under qtpropertybrowser solution.
Here is the error message I obtained :
1>------ Rebuild All started: Project: simple, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'simple', configuration 'Release|Win32'
1>Moc'ing qtpropertybrowserutils_p.h...
1>RCC ..\..\src\qtpropertybrowser.qrc
1>MOC ..\..\src\qtvariantproperty.h
1>MOC ..\..\src\qtpropertybrowser.h
1>MOC ..\..\src\qtgroupboxpropertybrowser.h
1>MOC ..\..\src\qtbuttonpropertybrowser.h
1>MOC ..\..\src\qttreepropertybrowser.h
1>MOC ..\..\src\qtpropertymanager.h
1>MOC ..\..\src\qteditorfactory.h
1>Compiling...
1>qrc_qtpropertybrowser.cpp
1>qtvariantproperty.cpp
1>qttreepropertybrowser.cpp
1>..\..\src\qttreepropertybrowser.cpp(1091) : fatal error C1083: Cannot open include file: 'qttreepropertybrowser.moc': No such file or directory
1>qtpropertymanager.cpp
1>..\..\src\qtpropertymanager.cpp(6470) : fatal error C1083: Cannot open include file: 'qtpropertymanager.moc': No such file or directory
1>qtpropertybrowserutils.cpp
1>qtpropertybrowser.cpp
1>qtgroupboxpropertybrowser.cpp
1>qteditorfactory.cpp
1>..\..\src\qteditorfactory.cpp(2592) : fatal error C1083: Cannot open include file: 'qteditorfactory.moc': No such file or directory
1>qtbuttonpropertybrowser.cpp
1>main.cpp
1>Generating Code...
1>Build log was saved at "file://c:\Documents and Settings\yan-cheng.cheok\Desktop\qtpropertybrowser-2.5-opensource\qtpropertybrowser-2.5-opensource\examples\simple\release\BuildLog.htm"
1>simple - 3 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Any suggestion to pass the compilation will be very much appreciated.
OK. Finally I figure out the workaround, I need to manually run the following command before clicking on the build all button.
moc qttreepropertybrowser > qttreepropertybrowser.moc
moc qtpropertymanager > qtpropertymanager.moc
moc qteditorfactory > qteditorfactory.moc
Not sure why. Qt people should include these command in their build file :(
I found the correct method. It will make mocking work from Visual Studio.
For e.g. to get moc file for "spell_checker.h"
I did following steps.
Right click on the header file -> Properties -> Custom Build Step -> General ->
Command Line = "$(QTDIR)\bin\moc.exe" -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SCRIPT_LIB -I".\GeneratedFiles\." -I"$(QTDIR)\include\." -I".\GeneratedFiles\$(ConfigurationName)\." -I".\." -I"$(QTDIR)\include\QtCore\." -I"$(QTDIR)\include\QtGui\." -I"$(QTDIR)\include\QtScript\." ".\spell_checker.h" -o ".\GeneratedFiles\$(ConfigurationName)\moc_spell_checker.cpp"
Description = Moc'ing spell_checker.h...
Outputs = ".\GeneratedFiles\$(ConfigurationName)\spell_checker.cpp"
additional dependencies = "$(QTDIR)\bin\moc.exe";.\spell_checker.h