postMessage not declared in this scope error when building nativeClient plugin - google-nativeclient

When I am trying to build the plugin module using .\scons it is raising me errors. What might cause these types of errors...? Error is
postMessage() was not declared in this scope.
I am using pepper_16 version. Here is the procee I did
Installed Python and gave the path required(Installed in D drive as I do not have privileges).
Downloaded nacl_sdk.zip extracted in the same folder where I have installed python and updated the tools with nacl_sdk.bat update
Enabled NativeClient form about:flags window and executed the server using httpd.py file.
And created project in Pepper_16/examples/TestApp using init_project.
Written the code as it is in the Getting started tutorial to test.
Then using ./scons in the same project folder in cmd mode I have tried to build
The above process worked fine for me where I have admin privileges. But the same procedure and same code not working where I do not have admin privileges.
Please let me know if any further details are required.

which source file was being compiled? a lengthier cut-n-paste of the output around the error message would help to give context.
also, when you say the plugin module, are you referring to NaCl itself or your own PPAPI plugin? normally NaCl's plugin is built into Chromium using gyp, and while scons can be used to build the NaCl plugin it is typically only used for testing, via the --register-pepper-plugin command line argument to chrome.

Related

Ionic push: web client incorrectly installs

Following the guidelines here: http://docs.ionic.io/docs/push-from-scratch I am having trouble with step 2 - installing ionic add ionic-platform-web-client.
My index file within my app adds <script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script> as it should, however the file doesn't exist at this location, even after running 'ionic lib update'.
(For ease of explanation in this section I am using the non minified version of the bundle: ionic.io.bundle.js (the results are the same with both full and minified versions of the files)).
Manually adding ionic.io.bundle.js from https://github.com/driftyco/ionic-platform-web-client/tree/master/dist will give me this error:
"Uncaught TypeError: Cannot call method 'get' of undefined
ionic.io.bundle.js (3429,0)"
from this code:
key: "get",
value: function get(name) {
return this._settings.get(name);
}
I found a 'hacky' way to get the dev pushes working by simply returning this instead of the full return this._settings.get(name) statement, although this only really suits the purpose of debugging and additionally does not allow removal of developer mode by settings 'ionic config set dev_push false' or manually setting "dev_push":false in .io-config.json.
I am unsure as to whether manually adding ionic.io.bundle.js is simply adding to my problems or whether this is the right approach to take and that the errors produced are the real problem?
I am running:
ionic 1.1.0
ionic CLI 1.7.7,
cordova 5.3.3,
bower 1.6.2,
npm 2.11.3,
visual studio 2015 community with cordova/ionic setup,
I've also updated my android platform - for which I am currently building to (deploying to nexus 7).
TheCannot call method 'get' of undefined in ionic.io.bundle.js happens because of missing settings in the bundle.
This could be fixed by running:
ionic config build
Although I still haven't been able to install the ionic web platform via 'ionic add ionic-platform-web-client' in the cli I have managed to get the ionic push notifications working.
Firstly I made sure in my app directory within the cli to use 'ionic lib update'. As the setup of my project was different (thanks to visual studio). You will likely already have these files using a custom setup, but I found it's good to have the directories in place.
Secondly I manually downloaded the web client https://github.com/driftyco/ionic-platform-web-client4 not just the ionic.io.bundle.min.js which seemed to fix my "Uncaught TypeError: Cannot call method 'get' of undefined" problem mentioned previously, after I moved the entirety of this in my lib directory. (Make sure the name of the downloaded folder matches: "ionic-platform-web-client" exactly, and doesn't contain any words like master).
Thirdly, as I couldn't add version 1.3.0 of the push plugin (which continually gave me the beloved 'uh oh' error) I used 1.2.3 instead. I installed this via: 'cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git#1.2.31'. Although I have just noticed 1.4.0 is available which may also work?
This should hopefully fix any issues you have, even if it's not a perfect solution. As a side note: I know it is mentioned somewhere on one of the ionic pages that you need to have a traditional project setup and then move the relevant files but it would be nice to have some description of how to go about this - as you may not know what the relevant files are. For anyone who comes here scratching their heads, If you're using visual studio to create your ionic projects from scratch or any other custom setup, you will likely run into the same issues, as the relevant directories created using 'ionic start myApp' will likely have been omitted.

Building NaCl SDK from source for ARM-32

I am trying to build Native Client SDK from source code following instructions on: www.chromium.org/nativeclient/how-tos/building-and-testing-gcc-and-gnu-binutils. After I run make clean build-with-newlib -j16, I get errors. When I saw the contents of Makefile, I realized that CROSS_ARCH was set to x86_64. Changing it to arm32 threw different kind of errors. What are the settings to generate binaries for ARM platform?

Cannot load sqlite.dll with QSQLITE2 Qt plugin

I use QtCreator + mingw.
I have compiled QSQLITE2 plugin. I simply entered plugin directory in Qt source code:
c:\Qt\Qt5.2.0\5.2.0\Src\qtbase\src\plugins\sqldrivers\sqlite
and I built it with my sqlite 2.8.17 that I have locally (as dll and header):
qmake "LIBS+=-Lc:\projects\lib -lsqlite" "INCLUDEPATH+=c:\projects\include"
make
make install
Everything builds okay.
Now, I have another DLL (also implemented as Qt plugin, a custom one), which makes use of QSQLITE2 Qt plugin. My own dll is also linked to sqlite.dll. So it looks like this:
my.dll depends on sqlite.dll
%QT_PLUGINS%\qsqlite2d.dll depends on sqlite.dll
my.dll uses qsqlite2d.dll through Qt's plugin engine
myApp.exe loads my.dll
Problem is that my application cannot load my.dll, because of invalid location access or something like that. I don't know any details and that's the problem.
The sqlite.dll is in the application directory when running it.
When I run application in debug mode, it crashes in some assembly file, but in stack trace I can see that it's somewhere inside sqlite.dll, in sqlite_step symbol. That's all I know.
Note 1) I have another plugin dll, the my3.dll, which uses QSQLITE plugin (it's for sqlite3) and is linked with sqlite3.dll and this one loads just fine. I have compiled QSQLITE plugin myself as well (even there was the one provided with Qt, that's because Qt linked statically to sqlite3 and I wanted it to link dynamically to sqlite3.dll).
Note 2) Both plugins work just fine under Linux.
Any hints what might be wrong? What else can I check?
EDIT:
I've just performed a test: I deleted my.dll from plugins to avoid loading it at all. Then I added code to main.cpp:
QSqlDatabase::addDatabase("QSQLITE2", ":memory:");
Thing is, that it also crashed, with the very same stack trace (at this very line, I debugged it). Thus I think there's something wrong with sqlite2 Qt plugin, but I'm still unable to tell what. I looked up for other sqlite.dll, I just downloaded the one from sqlite.org: http://www.sqlite.org/sqlitedll-2_8_17.zip - so it's official build, but it's the exactly the same file I had and it also fails the same way.
It turned out that qsqlite2d.dll cannot be linked sqlite.dll, because sqlite.dll is not compiled in debug mode. After recompiling application in release mode (thus using qsqlite2.dll, not qsqlite2d.dll), the plugin loads correctly and works.
This makes sense, but just one more thing that bugs me - qsqlited.dll (for sqlite3) had no problem linking with sqlite3.dll. No matter if I compiled debug or release - the single sqlite3.dll worked with both debug and release plugins. Anyone has an idea how is that possible? Please comment if you do, I'd appreciate it.

Running Custom Deployer from Eclipse

I've gone through Jaime's deployer tutorial.
I've successfully created my deployer extension, which when integrating with SDL Tridion, the functionality works exactly as required.
But, what i can't get to work is the local debugging / running with the deployer inside eclipse (documented here)
The eclipse based deployer does run. If I drop my zip file into my test incoming folder the zip is picked up and processed. However, the customdeployer code I have written is never entered or executed.
I don't get any errors in the 'eclipse' deployer logs, but it always stops on the following line:
2012-04-13 20:24:51,642 DEBUG QueueLocationHandler - Removing exclusive lock on Deployment package: tcm:0-1026-66560 with type: CONTENT.
As we've three developers here also stuck on the same problem on all their machines I was wondering (hoping!) that this was a common problem and someone knew what we're doing wrong.
Thanks
Can you check which cd_deployer_conf.xml is it loaded by the Deployer? Just check the Deployer startup logs (in debug mode).
I suspect your Eclipse project at Debug/Run time doesn't load the the cd_*_config.xml files from the config folder in Eclipse. This will prevent your deployer module (which I supposed you configured in your cd_deployer_conf.xml) from being loaded and called.
What I normally do is to declare this config folder as an Eclipse Source Folder. Then at Debug/Run time, Eclipse will be included in the classpath automatically. This makes point #8 from http://www.sdltridionworld.com/articles/sdltridion2011/tutorials/Deployer_Extensions_With_Eclipse_3.aspx redundant.
I ran into exactly the same problem after following the same deployer extension tutorial.
I managed to solve it by changing the name of the package that my module was in to be com.tridion.deployer.extensions
Previously my module had been in a package I had named com.yourcompany.tridion.deployer.extensions and this appeared to have the affect of preventing the deployer from loading my extension module.
I had this issue, with a slight variation in that originally it worked, but then it stopped working.
Turns out the deployment package was somehow getting corrupted(locked?) in the process, as when i tried with a backup of the deployment package from the previous day it worked just fine.

How to make Qt aware of the QMYSQL driver

I'm trying to access a MySql database from a Qt application but I get the following error:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE2
I find this very strange cause I have libqsqlmysql.so on my Qt folder. I have even tried to compile the MySql driver as a static plugin and add it to my .pro file as:
QTPLUGIN += qsqlmysql
But this also generates the same runtime error (it must've found the plugin cause there's no error compiling the application)
What am I missing? I would like to avoid having to compile Qt from source cause this will have to work seamlessly on the deploy machines as well.
BTW: Even though I'm developing and testing on Linux I will need to support Windows. Will I experience this same issue on Windows? How can I compile and link the MySql driver in both Linux and Windows?
The solution:
After following #Sergey's recommendations I did an strace of the application redirecting the output to grep so I could search for 'mysql' and for my surprise the application wasn't looking for the plugin at QTDIR/plugins/sqldrivers where I had libqsqlmysql.so, it was looking at QTDIR/lib. After copying the plugin to the lib folder the MySql connection worked.
Try opening the shared library with dlopen() and see if it loads and if not, what dlerror() tells you. I always run into similar problems on Windows. LoadLibrary()/GetLastError() saved me numerous times (last time it was because of a wrong version of some libiconv/libintl DLL). Running ldd on the plugin may also help.
If dlopen() works fine, try to load the plugin with QPluginLoader. If it doesn't load, then check the buildkey of the plugin. I usually do it the dirty way by running strings on the plugin and then looking for strings like "buildkey" or "QT_PLUGIN_VERIFICATION_DATA". Just looking at the build key and around it may give you an idea. For example, you may realize that you have compiled your plugin in the release mode while your application is compiled in the debug mode. In such case the build key won't match and the plugin won't load. Everything in the build key must match your configuration. Note that the version and the build key are checked differently: the build key must match exactly (or match some black magic called QT_BUILD_KEY_COMPAT), but in the version only the major version must match exactly, the minor version must be the version of Qt the plugin was compiled with or later and the patch level is ignored. So if your plugin was compiled with Qt 4.x.y then it will work with Qt versions 4.z.* where z>=x. This actually makes sense.
If the build key looks okay (which is unlikely if you got to this point), you may wish to look at QLibraryPrivate::isPlugin() source code to figure out what's wrong, but that doesn't look like an easy task to me (although running this in a debugger may help).
If QPluginLoader does load the plugin, check if it is in the right directory and has correct permissions. If you still didn't solve the problem by this point, it's time to look at the SQL module source code that actually loads these plugins. But it is extremely unlikely. I ran into this problem many, many times and it was always either the library not loading or the build key not matching.
Another way to go after QPluginLoader loads the plugin successfully is to use strace to figure out whether the program at least tries to open the plugin file. Searching for something like "sqldrivers" or "plugins" in the strace output should also give away the directory where Qt is searching for its plugins and specifically SQL drivers.
Update
Is it possible to compile the driver as a static plugin and don't worry about anything? Let's try:
d:\Qt4\src\plugins\sqldrivers\psql>qmake CONFIG+=static LIBS+=-Ld:/programs/Post
greSQL/lib INCLUDEPATH+=d:/programs/PostgreSQL/include
d:\Qt4\src\plugins\sqldrivers\psql>make
It compiles fine and now I got libqsqlpsql.a (release) and libqsqlpsqld.a (debug) in QTDIR/plugins/sqldrivers (it is the right place on Windows). I am using PostgreSQL driver here, but I don't think it will be any different for MySQL which I just don't have installed. Ok, let's compile some real program with it:
d:\alqualos\pr\archserv>qmake QTPLUGIN+=qsqlpsql PREFIX=d:/alqualos LIBS+=-Ld:/g
nu/lib INCLUDEPATH+=d:/gnu/include LIBS+=-Ld:/programs/PostgreSQL/lib LIBS+=-lpq
Note that I had to manually link to libpq, otherwise the linker would complain about undefined references. The funny thing is, qmake knows that qsqlpsql is located in QTDIR/plugins/sqldrivers and sets compiler and linker options accordingly. So it still needs to be in the right place to work, only you don't have to worry about your users running into the same problem as it is only used during compilation. An alternative would be to just use LIBS+=-Lpath/to/plugin LIBS+=-lqsqlpsql instead of QTPLUGIN+=qsqlpsql, at least the docs say that it should work, but I haven't tested it.
In order for the application to actually use the plugin I had to put the following in my main unit (CPP file):
#include <QtPlugin>
Q_IMPORT_PLUGIN(qsqlpsql)
It works! Also, from what I've been able to figure out from the sources, the build key and the version are checked only when a plugin is dynamically loaded (all the relevant stuff is in the QLibrary's private class, not even QPluginLoader's). So the resulting executable may (or may not, depending on the binary compatibility) work even with different versions and builds of Qt, although using it with older versions may trigger some bugs that were fixed later.
It is also worth noting that the order for loading SQL drivers is this: use the driver statically linked into Qt if available, then look for a driver registered manually with QSqlDatabase::registerSqlDriver(), then look for a driver statically imported into the application (the way described above), and finally try to load a shared plugin. So when you link statically, your users won't be able to use dynamically linked drivers they may already have, but will be able to use drivers linked statically into Qt (like in Ubuntu).
I compiled QT first and then realised that I need mysql as well. So I compiled mysql plugin by
executing following command in QT-DIR\src\plugins\sqldrivers\mysql folder.
Mysql plugin compile command
qmake "INCLUDEPATH+=$$quote(C:\Program Files\MySQL\MySQL Server 5.5\include)" "LIBS+=$$quote(C:\Program Files\MySQL\MySQL Server 5.5\lib\libmysql.lib)" mysql.pro
Plugings are then created in created in folder QT-DIR\plugins\sqldrivers.
However, when I tried to use it in my code. It failed with following error.
Error msg
QSqlDatabase: QMYSQLDriver driver not loaded
Solution
After some googling and checking Path variable I realised that the Mysql server lib
( C:\Program Files\MySQL\MySQL Server 5.5\lib) directory was not in my Path variable. I expect that the dll in this folder are used by the plugin at runtime. After including Mysql server lib in Path variable everything worked smoothly. Hope this information saves some hair on other programmers scalp, as I uprooted quite a few. :D
Last time I looked at this you needed to rebuild Qt from source and include the appropriate MySQL source.
Building Qt from the sources is not hard, it just takes a while. You are likely to have the required tools already.
A possible workaround may be to access the back-end over ODBC instead.
In order for your app to pick up the plugin at runtime, the shared library implementing the MySQL plugin needs to be placed in the correct directory. The best way of determining that directory is to check the output of QCoreApplication::libraryPaths. You can also force specific paths by using a qt.conf file.
Please note that plugins must be placed in subdirectories within the plugin path, and the final part of the path name (i.e., the parent directory of the shared libraries) cannot be changed. SQL drivers need to go in a directory named sqldrivers, i.e. <pluginpath>/sqldrivers. For more details on plugin directories, see How to Create Qt Plugins.
I was experiencing this same issue as well. I've been installing and experimenting with a lot of different Python tools and UIs. I then uninstalled everything python related. I did a fresh install of Python 3.2, PyQT 3.2, and Eric5. No more errors with the QMySQL driver.
well i have had this issue, and after a lot of time, and different tools, i found that QT ( on windows, have not been able to test on Linux.) loads the "QSQLMYSQL.." when requested, but before runtime the lib ("QSQLMYSQL..") file must reside on one of the searched paths (QApp.libraryPaths()) inside a folder called "sqldrivers".. otherwise QT will just ignore the file, even if it is at some other point inside the searched path.
what i did was to monitor the dependency of a sample app, and when i removed the "QSQLMYSQL.." dll from "plugins\sqldrivers\" it failed, but when i maded a folder inside the app folder, called "sqldrivers" and placed the "QSQLMYSQL..." inside there, it loaded.
what i have is mysql 5.5, qt 4.7.4.
hope anyone can use this, and if anyone knows more about it, i would like to know where to find it(http://doc.qt.nokia.com/stable/sql-driver.html, is the closest you can get to the information about the folder structur). :P
This may also happen if your QMYSQL plugin is linked against the "wrong" mysql_client.a or it isn't in the LD_LIBRARY_PATH. I had this problem on OSX because mysql was installed via ports, and I fixed it with:
install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient_r.18.dylib libqsqlmysql.dylib

Resources