kli*_*eta 7 c c++ linker gstreamer
我有一个非常奇怪的问题,因为我不可能发送代码,我会尝试解释.
这更像是哲学问题 - 我希望有人有时间/知识来思考这个问题.
1)我的project.cpp看起来完全像这样:
#include <pthread.h>
#include <unistd.h>
pthread_t pplayer_thread;
void *play(void*);
int main(int argc, char **argv) {
pthread_create(&pplayer_thread, NULL, play_cb, NULL);
usleep(5000000);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
2)pplayer.cpp看起来像这样:
...
void *play_cb(void *arg) {
// this starts movie using gstreamer and exits thread
}
...
Run Code Online (Sandbox Code Playgroud)
3)not_executed _from_main.cpp看起来像这样:
...
extern MyClass *myObj; // this is included from .h file
...
MyClass *myObj = NULL;
...
some_function() {
...
myObj = MyClass::createNew(args);
...
}
...
Run Code Online (Sandbox Code Playgroud)
这些都与各种其他图书馆和大量垃圾联系在一起,但这基本上是重要的.
- > 问题:
当我运行它时,我应该看到窗口使用gstreamer播放影片剪辑5秒钟 - > 但我只听到声音!
- > 奇怪的事:
当我评论这条线时:
myObj = MyClass::createNew(args);
Run Code Online (Sandbox Code Playgroud)
并再次运行 - >我也看到gstreamer窗口(一切都很好)
- > 注意事项:
这可能与以下内容有关:
- > 我再问一次:
如何从未执行的代码中进行小的更改会产生影响?
(请帮忙)
最有可能的是它与 stackoverflow 有关。你有一些东西做了一些坏事,解决了越界的问题或一些其他未定义的行为,并且这只在某些特定的配置中触发(或不触发)。添加或删除变量声明就是这样的事情。