- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我真的很惊讶,今天我下载了 Ubuntu 12 LTS 32 位并安装了 build essential。
然后我为我的项目创建了一个 makefile,我只是从互联网上的另一个项目复制粘贴并编辑了一些以启用 C++11 的东西,如果它需要 GLM 的东西?
无论如何生成文件:
GPP = g++
GCC = gcc
plugin_OUTFILE = "./QuaternionStuff.so"
COMPILE_FLAGS = -std=c++0x -m32 -O3 -fPIC -c -I ./ -w -D LINUX -D PROJECT_NAME=\"plugin\"
plugin = -D plugin $(COMPILE_FLAGS)
all: plugin
clean:
-rm -f *~ *.o *.so
plugin: clean
$(GPP) $(plugin) ./*.cpp
$(GPP) -std=c++0x -m32 --static -fshort-wchar -shared -o $(plugin_OUTFILE) *.o
现在,当我运行它时,linux 会吐出错误,我真的不明白它们......
现在,代码可以在 Windows 上运行,可以在最高警告级别等情况下正常编译,非常好!
但是 g++ 程序对此有点不满意:
no matching function for call to ‘GetPitchYawBetweenCoords(glm::vec3, glm::vec3, glm::vec2&)’
note: glm::vec2 GetPitchYawBetweenCoords(glm::vec3&, glm::vec3&)
note: candidate expects 2 arguments, 3 provided
//prototypes:
inline glm::vec2 GetPitchYawBetweenCoords(glm::vec3 &source, glm::vec3 &target);
inline void GetPitchYawBetweenCoords(glm::vec3 &source, glm::vec3 &target, glm::vec2 &output);
以及代码,以及调用它的相应函数:
//the call
inline void AmxSetVector3(AMX * amx, cell * ¶ms, unsigned char startpos, glm::vec3 vector)
{
//some code here
}
inline void AmxSetVector2Inverse(AMX * amx, cell * ¶ms, unsigned char startpos, glm::vec2 vector)
{
//some code here
}
static cell AMX_NATIVE_CALL GetPitchYawBetweenPositions( AMX* amx, cell* params )
{
glm::vec2 rot;
GetPitchYawBetweenCoords(AmxGetVector3(params,1),AmxGetVector3(params,4),rot);
AmxSetVector2Inverse(amx,params,7,rot);
return 1;
}
它怎么能不区分这两个非常不同的功能(原型(prototype))呢?这是所有错误中最令人困惑的部分,但还有更多:(
我看不出有什么问题。
所以,我所做的是:我改变(非常痛苦,因为现在我的代码变得古怪,因为我需要改变一切只是为了 linux 发行版)不同名称的函数,我只是在第二个原型(prototype)结束,但又出现了一大堆错误..
In function ‘cell SomeFunction(AMX*, cell*)’:
error: invalid initialization of non-const reference of type ‘glm::vec3&
{aka glm::detail::tvec3<float>&}’ from an rvalue of type ‘glm::detail::tvec3<float>’
这又是......在同一个函数上......:
static cell AMX_NATIVE_CALL GetPitchYawBetweenPositions( AMX* amx, cell* params )
{
glm::vec2 rot;
GetPitchYawBetweenCoords(AmxGetVector3(params,1),AmxGetVector3(params,4),rot);
AmxSetVector2Inverse(amx,params,7,rot);//HERE
return 1;
}
这是怎么回事?我不知道如何解决这个问题..
G++版本为4.6
最佳答案
显然,AmxGetVector3
返回 glm::detail::tvec3<float>
.
根据标准,这个临时对象不能绑定(bind)到非常量引用(这是第二条消息试图告诉你的)。
不幸的是,Visual C++ 有一个愚蠢的非标准扩展,默认情况下启用,它允许这种绑定(bind)。
更改您的函数以具有这些(const-correct)原型(prototype):
inline glm::vec2 GetPitchYawBetweenCoords(const glm::vec3 &source, const glm::vec3 &target);
inline void GetPitchYawBetweenCoords(const glm::vec3 &source, const glm::vec3 &target, glm::vec2 &output);
关于c++ - "Cross-compatible"代码在 linux 中吐出错误并在 windows 上编译正常! (GLM),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17985432/
我正在尝试自己编译跨平台工具链。 当我编译 binutils-2.22 时,它成功了,但为什么会出现“检查我们是否正在交叉编译...否”?我想应该是"is",对吧? 我的主机是运行 ubuntu 的
设置: 有远程测量站,有集中收集/处理/呈现服务器(带有网络服务器),还有观测站,为客户显示收集到的数据。 这些观测站由简单的嵌入式计算机组成,配备网络浏览器,以信息亭模式工作,每个观测站显示来自中央
我对 Spark 和 Scala 很陌生,我正在编写 Spark SQL 代码。我可以在我的逻辑中应用 CROSS JOIN 和 CROSS APPLY。在这里,我将发布必须转换为 Spark SQL
警告是: jquery-1.9.1.js:8526 跨源读取阻止 (CORB) 阻止跨源响应 https://www.metaweather.com/api/location/search/?quer
我正在尝试对用户进行身份验证,但由于Cross-Origin Read Blocking (CORB) blocked 问题我的 login.ts 代码是 if (this.plugins.isOnl
这是我的表格 public class TaskForm extends WebForm { public TaskForm(){ this(new TaskModel());
首先,对不起我的英语语言不好,我是初学者程序员。在我的项目中,我使用线程类,但完成后我看到了这个异常: Cross-thread operation not valid: Control 'lblp4
我目前正在为一个项目开发前端(VueJS),为了测试我的登录和注册逻辑,我使用 laravel 作为后端,尽管我们实际上将使用 springboot 作为后端。我在桌面上编码,一切正常。所以我开始使用
我一直认为,就主要浏览器在不同平台上的渲染而言,唯一的区别是操作系统的底层字体渲染技术,其他一切都依赖于浏览器中包含的相同库。 就我的研究而言,前端开发人员要么相信,要么不相信。似乎我们可以选择任何一
我需要在我正在处理的网站中显示一些交互式(附加 DOM 监听器等和事件处理)矢量图形。 W3C 推荐了 SVG,尽管 Internet Explorer 支持仍然无法识别这种格式,这是必须的(对于公共
子域是否有跨域策略限制? 如果我在 paint.xxxx.com 上有申请这是处理来自 image.xxxx.com 的图像,有没有跨域问题? 我问这些问题,因为我正在考虑在子域上放置一个代理。 最佳
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 6年前关闭。 Improve this questi
一个项目迫在眉睫,我将要编写的一些代码可能会部署在潜在客户碰巧拥有的任何硬件上。它是一个 24/7 全天候运行的业务应用程序,因此我设想大多数主机将是服务器类型的机器,但较小的客户端可能只有一台简单的
首先,我不反对Opera。似乎当我遇到跨浏览器问题并进行一些研究时,总能找到“解决办法”,但是随后我看到一条评论,说我正在查看的跨浏览器解决方案无法在Opera中使用,这是一种愚蠢的评论。 我应该在乎
作为优秀的开发人员,我们尽可能保持我们的代码符合标准,以帮助平台之间的移植。但是有哪些工具可以帮助我们以统一的方式跨多个平台构建代码。 *nix 家族有 make但 Windows 需要 nmake
我目前正在构建浏览器帮助对象。 的事情之一BHO要做的是绕过跨域策略进行跨站请求。 为此,我公开了 __MyBHONameSpace.Request使用 WebClient 的方法内部。 然而,我想到
我开发了一个 NP API 插件并正在使用它。我观察到以下两件事 当我第一次安装插件时,我需要重新启动我的 mac os 以加载插件。 每当我更新插件时,我都需要重新启动浏览器。 我想在不重新启动浏览
浏览器在接收到“足够”的数据后或数据停止流入后呈现内容(例如,达到内容长度)。 我要慢慢地将数据流式传输到浏览器;为此,我必须解决此数据缓存问题。 例如,不是发送 40 字节的 JavaScript,
我搜索了一些关于跨平台编程开发的文献,但没有找到真正好的东西。 我不是在寻找像 Java 那样的跨平台虚拟机。 有没有关于这方面的书籍或文献? 最佳答案 我会说这归结为: 不使用非标准的“标准库”功能
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 7年前关闭。 Improve t
我是一名优秀的程序员,十分优秀!