<div dir="ltr">To elaborate further, i created a global variable in /vlc/src/playlist/thread.c<div style>It is extern in playlist_internal.h</div><div style><br></div><div style>This variable is read from in the LoopRequest function when a playlist is signaled to start playing.<br>
</div><div style><br></div><div style>Before the start of a play list some gui dialogs appear which are located in modules/gui/qt4/dialogs (some what similar to firstrun.cpp).</div><div style><br></div><div style>Now if firstrun.cpp has extern the same variable i.e. (extern type name), and it is filled with in this dialog (actually it is a c string i.e. char array filled from a QString using <span class="" style="white-space:pre">        </span>strcpy(c_string, q_string.toLocal8Bit().constData()). This compiles successfully, but i get following run time errors with no GUI loaded.</div>
<div style><br></div><div style><div>no suitable dialogs provider found (hint: compile the qt4 plugin, and make sure it is loaded properly)</div><div>[0x1ea18b8] skins2 interface error: cannot instantiate qt4 dialogs provider</div>
<div>[0x1ea18b8] main interface error: no suitable interface module</div><div>[0x1e72388] main libvlc error: interface "default" initialization failed</div><div><br></div></div><div style><br></div><div style>I have tried several other combinations like instead of using extern, declaring the variable in playlist_internal.h or say vlc_common.h and including the header file on the gui side (if not included already) or vice versa. But usually i start getting multiple inclusion errors though the variable is only created once.</div>
<div style><br></div><div style>All errors go away as soon as i comment out the variable from any one side or even if i make it static on one side. GUI starts loading normally.</div><div style><br></div><div style>Can some one help?</div>
<div style><br></div><div style>Regards,</div><div style>Fayyaz</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 5:16 PM, Fayyaz Khan <span dir="ltr"><<a href="mailto:fayyazkl@gmail.com" target="_blank">fayyazkl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Thank you Remi.<br>
<br>
I understand that well and probably that is not a problem in my case.<br>
<br>
The shared variable (char array) that i wish to create will be updated by a dialog in the beginning of the program (though it can be chosen from a list of dynamic options), before playlist components picks it up. So there will be no sync issue.<br>

<br>
Moreover, i am using PL Lock / unlock in both scenarios to ensure synchronized access.<br>
<br>
Could you please elaborate a little more on a good location in source code to prevent other include file issues? Right now i am a victim of those.<br>
<br>
Thank you<span class=""><font color="#888888"><br>
Fayyaz</font></span><div class=""><div class="h5"><br>
<br>
On 1/9/2013 5:11 PM, Rémi Denis-Courmont wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Wed, 9 Jan 2013 14:28:28 +0500, fayyaz lodhi <<a href="mailto:fayyazkl@gmail.com" target="_blank">fayyazkl@gmail.com</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
What is the correct way of sharing data between the two?<br>
</blockquote>
I don't need to remind you that the multi-threaded memory model (either<br>
POSIX or C11) forbids sharing data directly unless the data is constant<br>
read-only.<br>
<br>
You need to add functions instead, including appropriate synchronization<br>
depending on the actual case.<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>