Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can a small change in a code which is never executed make a difference?
    primarykey
    data
    text
    <p>I have a <strong>very strange</strong> problem and since it is not possible for me to send code I will try to explain.</p> <p>This is more like philosophical problem - I hope someone has time/knowledge to think about this.</p> <p>1) I have project.cpp looking exactly like this:</p> <pre><code>#include &lt;pthread.h&gt; #include &lt;unistd.h&gt; pthread_t pplayer_thread; void *play(void*); int main(int argc, char **argv) { pthread_create(&amp;pplayer_thread, NULL, play_cb, NULL); usleep(5000000); return 0; } </code></pre> <p>2) pplayer.cpp looking something like this:</p> <pre><code>... void *play_cb(void *arg) { // this starts movie using gstreamer and exits thread } ... </code></pre> <p>3) <strong>not_executed</strong>_from_main.cpp looking something like this:</p> <pre><code>... extern MyClass *myObj; // this is included from .h file ... MyClass *myObj = NULL; ... some_function() { ... myObj = MyClass::createNew(args); ... } ... </code></pre> <p>This is all linked together with various other libraries and ton of garbage, but this is basically what is important.</p> <p>--> <strong>Problem</strong>:</p> <p>When I run this, I should see window playing movie clip using gstreamer for 5 seconds -> <strong>BUT I only hear sound!</strong></p> <p>--> <strong>Strange thing</strong>:</p> <p>When I comment the line:</p> <pre><code>myObj = MyClass::createNew(args); </code></pre> <p>and run again --> I see gstreamer window also (everything is fine)</p> <p>--> <strong>Notes</strong>:</p> <p>this may have something to do with:</p> <ul> <li><strong>linking process</strong> and <strong>nature of MyClass and it's parent class</strong> (my best guess)</li> <li>"static" keyword</li> <li>"external" keyword</li> <li>C and C++ mixing</li> </ul> <p>--> <strong>I ask once more</strong>:</p> <p><strong>How can a small change in a code which is never executed make a difference?</strong></p> <p>(please help)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload