无法在qSqlite中加载Spatialite扩展(QT 5.9)(Could not load Spatialite extension in qSqlite ( QT 5.9))
我试图在qSqlite(Qt 5.9)中加载Spatialite作为扩展,我在Qt4.8之前已经完成了,但是我在QT5.9中失败了。 我通过删除“SQLITE_OMIT_LOAD_EXTENSION”更改了sqlite.pri,并通过删除“
#define SQLITE_OMIT_LOAD_EXTENSION 1
”并添加“#define SQLITE_ENABLE_LOAD_EXTENSION 1
”对sqlite.c进行了一些更改。 我还将以下行添加到openDatabase(....)#if defined(SQLITE_ENABLE_LOAD_EXTENSION) | SQLITE_LoadExtension|SQLITE_LoadExtFunc #endif
现在是“requet.setQuery(”SELECT load_extension('spatialite')“,dbProject);” 函数被识别,但我收到此消息:错误“无法找到指定的过程。\ r \ n无法获取行”如果我查看MSVC14中的调试输出,我可以看到spatialite.dll和所有它的依赖项已被加载。
注意:我用我的Spatialite和我从他们的网站下载的mod_spatialite测试了这个。
关于这个问题的任何想法? 提前致谢。
I am trying to load Spatialite as extension in qSqlite ( Qt 5.9), I have done that before with Qt4.8, but I failed with the QT5.9. I changed the sqlite.pri by removing "SQLITE_OMIT_LOAD_EXTENSION", and I did some change on the sqlite.c by removing the "
#define SQLITE_OMIT_LOAD_EXTENSION 1
", and adding "#define SQLITE_ENABLE_LOAD_EXTENSION 1
". I also add the following lines to openDatabase(....)#if defined(SQLITE_ENABLE_LOAD_EXTENSION) | SQLITE_LoadExtension|SQLITE_LoadExtFunc #endif
Now the "requet.setQuery("SELECT load_extension('spatialite')", dbProject);" function is recognized, but I got this message: error "The specified procedure could not be found.\r\nUnable to fetch row" If I take a look on my debug output in MSVC14, I can see that the spatialite.dll and all its dependencies have been loaded.
Notice: I tested this with my Spatialite and also the mod_spatialite that I download form their website.
Any ideas about this problem? Thanks in advance.
原文:https://stackoverflow.com/questions/44427868
最满意答案
确保正确定义了
ajax_object.cartclass
。var ajax_object = {}; ajax_object.cartclass = "testing"; // The class you're trying to listen to.
在那之后你的代码应该正常工作,假设你有一个定义的类
ajax_object.cartclass
,它包含一个类add
a
元素:<div class="testing"><a class="add">Test this</a></div>
现在应该有以下工作:
$('.' + ajax_object.cartclass).on('click','a.add',function(e) { console.log("hey"); // Console will output "hey" now. e.preventDefault(); });
你的代码应该在那之后正常工作。
这是一个演示 。
Make sure that
ajax_object.cartclass
is properly defined.var ajax_object = {}; ajax_object.cartclass = "testing"; // The class you're trying to listen to.
Your code should work properly after that, assuming you have a defined element of class
ajax_object.cartclass
which contains ana
element of classadd
:<div class="testing"><a class="add">Test this</a></div>
The following should now work:
$('.' + ajax_object.cartclass).on('click','a.add',function(e) { console.log("hey"); // Console will output "hey" now. e.preventDefault(); });
Your code should work fine after that.
Here's a Demo.
相关问答
更多-
从我所看到的异常似乎以某种方式由您正在使用的jScrollPane插件触发。 尝试用直接从中继线更新的版本替换您包含的脚本(v1.2.3与2008年12月相同)。 其中包括对v.1.2.3的许多改进,并修复了我的异常jScrollPane.js ( jScrollPane.min.js用YUICompressor缩小了r87 jScrollPane的缩小版本) 删除旧的答案的东西不再需要 From what I can see the exception seems to be somehow trigge ...
-
确保正确定义了ajax_object.cartclass 。 var ajax_object = {}; ajax_object.cartclass = "testing"; // The class you're trying to listen to. 在那之后你的代码应该正常工作,假设你有一个定义的类ajax_object.cartclass ,它包含一个类add a元素: 现在应该有以 ...
-
这是因为模板标签内的标识而发生的。 检查一下: jquery-htmlstring-versus-jquery-selectorstring 您可以使用$.parseHTML()来避免它: data.context = $($.parseHTML(tmpl("template-upload", file))[1]) This is happening because of the identation inside your template tag. Check it out: jquery-htmls ...
-
未捕获的错误:语法错误,无法识别的表达式:使用.replace为7%(Uncaught Error: Syntax error, unrecognized expression: 7% with .replace)[2024-01-22]
我的猜测是仅仅使用slice()去除最后一个字符。 这会给一些像: var percent_removed = percent.slice(0,-1); My guess would be to simply remove the last character using slice(). this would give something like: var percent_removed = percent.slice(0,-1); -
抛出新错误(“语法错误,无法识别的表达式:”msg);(throw new Error( “Syntax error, unrecognized expression: ” msg );)[2023-07-12]
密钥是您的文件名称 - home.js它不是erb或任何其他rails模板文件。 它是一个独立的JavaScript文件,它不知道rails语法或任何或您的后端对象。 它在客户端编译,服务器“按原样”将其提供给浏览器 您必须将该脚本放在erb文件中才能像这样工作。 $('#save_property_result.id').slideToggle(); This helped me in solving the problem -
你的情况是错误的。 它说“如果nestedQuestion不为null 或 nestedQuestion不是"" ...”但是""不为null ,所以条件对于""是正确的。 将其更改为和 ( && ): if(nestedQuestion != null && nestedQuestion != "") { 或者只是使用null和""都是虚假的事实 : if(nestedQuestion) { 实际上, attr永远不会给你null 。 它只会给你一个字符串(可能是"" )或undefined 。 (但 ...
-
您的类选择器中包含$字符 - 这些都需要进行转义。 需要转义jQuery选择器字符串中的特殊字符 jQuery选择器值转义 http://samuelsjoberg.com/archive/2009/09/escape-jquery-selectors Your class selector has $ characters in it - these need to be escaped. Need to escape a special character in a jQuery selector st ...
-
你有意想不到的:在你的选择器中。 正确的选择器将是 $("#EMPLOYEE_ALT option[value='"+$("#EMPLOYEE_ID").val()+"']").remove(); You have unexpected : in your selector. The correct selector would be $("#EMPLOYEE_ALT option[value='"+$("#EMPLOYEE_ID").val()+"']").remove();
-
在jQuery("a[data-gal^='prettyPhoto'")选择器中看起来像你缺少了] 。 jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({overlay_gallery: false, social_tools:false, hook: 'data-gal'}); Seems like you are missing ] in jQuery("a[data-gal^='prettyPhoto'") selector. jQuery("a[d ...
-
uncaught语法错误,无法识别的表达式选项:包含(uncaught Syntax error, unrecognized expression option:contains)[2022-03-11]
问题是包含和之间的空白区域( $("#divFieldAssignment #EmpId option:contains (" + CompleteName + ")").attr('selected', 'selected'); ^ 删除空格将修复错误。 CSS选择器中的空格是分隔符? 在选择器的一部分和下一部分之间 contains无效 contains(whatever)有效 The problem is wi ...