static linking of postgresql plugin in Qt 5.5 - postgresql

when trying to link my linux (CentOS 7) application against static qt 5 libraries I get the following error:
debug/app_debug_plugin_import.o: In function `StaticQPSQLDriverPluginPluginInstance::StaticQPSQLDriverPluginPluginInstance()':
<src>/app_debug_plugin_import.cpp:24: undefined reference to `qt_static_plugin_QPSQLDriverPlugin
linking to the mysql plugin works.
I followed the tutorial here:
http://doc.qt.io/qt-5/sql-driver.html#qpsql
And I have both plugins (libqsqlpsql.a and libqsqlmysql.a)
But the mysql plugin defines the function:
qt_static_plugin_QMYSQLDriverPlugin()
While the psql plugin has no equivalend function.
What am I missing.
Thanks in advance

It seems that is was caused by remaining compiled object files that were compiled with an old qmake (from Qt 4.7)
After cleaning them up, it compiled correctly.

Related

Setting up LWJGL 3.0 with Netbeans

Downloaded LWJGL 3.0 from lwjgl.org, which only had the lwjgl.jar file in the jar subdirectory. The native directory only has files like libglfw.so but no subdirectories at all (and certainly not native/windows).
Created a library LWJGL30 with the lwjgl.jar file.
Added it to my project's library. and to the Project Properties->Libraries->Compile and Run.
Set the JVM launch argument in Project Properties->Run to -Djava.library.path=C:\Users\Owner\Documents\lwjgl\native for the VM Options
Copied the HelloWorld example from the link
Then ran and I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not
initialize class org.lwjgl.system.Library at
org.lwjgl.system.MemoryAccess.(MemoryAccess.java:22) at
org.lwjgl.system.Pointer.(Pointer.java:22) at
org.lwjgl.glfw.GLFW.(GLFW.java:594) at
mylwjgl.MyLWJGL.run(MyLWJGL.java:43) at
mylwjgl.MyLWJGL.main(MyLWJGL.java:140)
C:\Users\Owner\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53:
Java returned: 1 BUILD FAILED (total time: 7 seconds)
I have checked, double checked, triple checked as well as searching online for an answer as it should work but it does not. Any help would be appreciated.
This error occurs when LWJGL is unable to find the native files. Make sure java.library.path actually points to the directory with LWJGL's natives (which have extensions like .dll, .so and .dylib). Be careful with spaces in the path: You have to wrap the path in quotation marks or it won't work.
The issue was I was running the HelloWorld example using the Stable version of LWJGL 3.0. When I switched to the Latest version, everything worked as expected.

Issue with the checkstyle,findbugs and pmd plugins for SonarQube5.3 version

I am getting the below mentioned error when the following plugins are included:
sonar-checkstyle-plugin-2.4.jar
sonar-findbugs-plugin-3.3.jar
sonar-pmd-plugin-2.5.jar
Logs:
ERROR : java.lang.IllegalStateException: Fail to instantiate class
[org.sonar.plugins.checkstyle.CheckstylePlugin] of plugin [checkstyle]
at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:146) ~[sonar-core-5.3.jar:na]
at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:73) ~[sonar-core-5.3.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.loadInstances(ServerPluginRepository.java:274) ~[sonar-server-5.3.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:108) ~[sonar-server-5.3.jar:na]
The same error is given for the above mentioned plugins.
As these versions are supported for the version 5.3 (with reference to compatibility matrix in official documentation), need some help regarding fixing this error.
I am using MySQL database for the SonarQube 5.3. The installation works fine when the above mentioned plugins are removed from SONAR_HOME/extensions/plugins directory.
Is there some issue with this plugins for version 5.3? Has anyone tested these plugins on this version? Let me know if anyone has faced same issues and found out the solution to this problem.

PL/Java - user function execution error

I installed pl/java on Ubuntu with:
sudo apt-get install postgresql-9.1-pljava-gcj
but have hit a snag which I think is a gcj/jdk 1.7 incompatibility between the jar and pl/java. These are the steps used with guidance from http://www.javacodegeeks.com/2012/10/introduction-to-postgresql-pljava.html:
select sqlj.install_jar('file:///home/me/temp/testJar.jar', 'sandbox', true);
select sqlj.set_classpath('public', 'sandbox');
CREATE FUNCTION public.hello(varchar) RETURNS varchar
AS 'sandbox.PLJava.hello'
LANGUAGE java;
We're happy until execution:
SELECT hello('world');
Which generates this error:
ERROR: java.lang.ClassFormatError: sandbox.PLJava (unrecognized class file version)
SQL state: XX000
The jar was made with a standard eclipse/export to jar (jdk 1.7.0).
Anyone travel this road before? Thanks in advance.
This problem would be caused by, as you say, an incompatibility between the JVM that you are running via pl/java and your java code. This is hence a packaging issue if you are running everything from repos and you can follow up with your distro or compile from source.
If you can compile from source, that may be the best option at present.

Overlapping instances error for Yesod and EclipseFP application

I created an application with EclipseFP, the yesod application. With the out of the box settings, I get an error when I try to run a 'main.hs' file. It looks like it compiles but when I try to run I get the error. I attempted to run by 'right clicking' and then 'run'. The console opens:
What might be the issue?
Here is the error:
<command line>:
Could not find module `OverlappingInstances':
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Prelude> main
Version: Indigo Service Release 2
Eclipse FP Haskell Plugin - 2.2.4
GHC version 7.0.3
Possible solutions:
I tried to add '{-# LANGUAGE OverlappingInstances #-}' at the top of all of the haskell files
This is a bug, I've fixed it in the github version of EclipseFP/BuildWrapper. Will be part of the 2.3.0 release of EclipseFP. We're getting the wrong options from the cabal file and pass OverlappingInstances to GHCi without the -X. Sorry!

Compiling Scala^Z3 on Windows

I tried to compile Scala^Z3 on Win XP using Cygwin and JDK 1.7.0 but it didn't work out as expected.
I did the following:
- Use SBT 0.7.4
- Use current Scala^Z3 revision from github
- Use Cygwin and its gcc
- Use JDK 1.7.0 (javac)
"sbt update" was successfull.
"sbt package" end up in several errors stating undefined references like the following:
\psuter-ScalaZ3-35cb691\src\c/z3_Z3Wrapper.c:10: undefined reference to `_Z3_mk_config'
In order to make it work at all I changed ....\PSuterScalaZ3\psuter-ScalaZ3-35cb691\project\build\scalaz3.scala line 74 to:
lazy val gcc : ManagedTask = if(isUnix || is32bit) {
On the homepage it is stated that it should work for Windows, too. Does it at all?
Is there a precompiled jar available?
I saw a z3.jar here: http://lara.epfl.ch/~psuter/jniz3/z3.jar
This is a Linux Version too, I guess? Because it didn't work for me either...
Scala^Z3 is a really good piece of code (if i can get it to work ;))
Sorry about that, the sbt script indeed currently only works for Linux (and as you can tell by the absolute path, we're not quite used to having external users yet).
Here are the steps I use to compile it under Windows:
compile all Java sources with javac (there are no dependencies)
generate the header files using javah
compile all the Scala sources with scalac (using only the Java .class files as dependencies)
compile the .c + .h files with Visual Studio
manually create a jar file with everything
We also hope to release a precompiled .jar file with the shared library for Linux and Windows once we adapted Scala^Z3 to the new changes in Z3 3.1.
EDIT The GitHub repository now contains a precompiled .jar file prepared for Scala 2.9.1 and Z3 3.2. It works under Windows and Linux (32bit). The repository also contains more detailed instructions on how to compile the shared library in Windows, using MinGW instead of Visual Studio (hence removing the need for VS runtime libraries).
I had a similar problem some months back and here is what it I had to do in order to compile it with Visual Studio 2010. I am not sure if it is still relevant since Scala^Z3 and Z3 itself changed a lot, but I hope it nevertheless is helpful.
Created a new Visual C++ Win32 project (.NET Framework 4) for
creating DLLs.
Added all .h and .c files in the src/c/ directory. VC somehow
complained about the "inline" modifier and a work mate suggested to
remove them, which I did.
Added z3.h from Z3 2.19, Z3 2.16 wasn't accepted. Also added the
corresponding z3.lib (x86, haven't tried x64 yet). VC wouldn't accept
z3.dll and complaint about the file being corrupt. No clue why, Z3
itself works fine for me.
The project compiles with 13 warnings and a dll is created which
apparently MUST be named scalaz3.dll.
sbt compile, adding scalaz3.dll to lib-bin, jar the whole thing
together to scalaz3.jar
'scala -classpath scalaz3.jar test.scala' with scalaz3.jar and z3.dll
in the current folder works