Note that there are some explanatory texts on larger screens.

plurals
  1. POmingw ignores '-L' flag
    primarykey
    data
    text
    <p>I am getting linker failures under <code>MinGW</code>, however I cannot see why. This is the link command:</p> <blockquote> <p>g++ -shared -mthreads -Wl,--out-implib,C:\Users\camm\Syren\libs\libSy_polyMesh.a -o C:\Users\camm\Syren\libs\Sy_polyMesh.dll debug/Sy_polyMesh.o debug/moc_Sy_polyMesh.o debug/qrc_Sy_polyMesh.o -L"c:\Qt\4.8.4\lib" -lglu32 -lopengl32 -lgdi32 -luser32 -LC:\Users\camm\Syren/libs -lSyren -lglew32 -lboost_system -lQtSvgd4 -lQtSqld4 -lQtOpenGLd4 -lQtGuid4 -lQtCored4</p> </blockquote> <p>The <code>undefined reference</code> errors come from the <code>Syren</code> dll (I should state the command was automatically generated by <code>qmake</code>). The <code>-LC:\Users\camm\Syren/libs</code> looks malformed to me because of the mix of forward and backslashes, but if I manually set them to all one way or the other - it does not change the compiler output.</p> <p>I had earlier problems with 3rd party libraries I needed (GLEW and Boost specifically), but because they were relatively 'constant' I didn't have a problem putting them in my <code>C:\MinGW\lib</code> directory. But that is really not an option for my plugins.</p> <p>What I find is that the MinGW <a href="http://www.mingw.org/wiki/HOWTO_Specify_the_Location_of_External_Libraries_for_use_with_MinGW" rel="nofollow">docs</a> state in a few locations:</p> <blockquote> <p>...since suitable search paths may always be specified using -L options.</p> <p>...but that GCC itself furnishes the effective defaults, by supplying appropriate -L options.</p> </blockquote> <p>However, <code>C:\Users\camm\Syren\libs</code> is where <code>Syren.dll</code> resides!</p> <p><strong>Edit:</strong> Here are the LIBS declarations in my <code>.pro</code> file:</p> <pre><code>LIBS += -L$(SYREN_PATH)/libs \ -lSyren win32 { LIBS += -lglew32 \ -lboost_system } </code></pre> <p>And <code>$(SYREN_PATH)</code> expands to <code>C:\Users\camm\Syren</code>. Also I can see to the 'missing' symbols in <code>Syren.dll</code>, for example:</p> <blockquote> <p>C:\Users\camm\Documents\Syren\Sy_polyMesh_debug/../Sy_polyMesh/src/Sy_polyMesh.cpp:341: undefined reference to `Sy_GLBuffer::unbind()'</p> </blockquote> <p>Can be seen listed as:</p> <blockquote> <p>6c500bd6 T _ZN11Sy_GLBuffer6unbindEv</p> </blockquote> <p><strong>Edit2</strong></p> <p>After adding a verbose flag to the linker stage I noticed that the linker was iterating through each search path and then through each library naming convention, and using the first one it could open.</p> <pre><code>attempt to open C:\Users\camm\Syren/libs/libSyren.dll.a failed attempt to open C:\Users\camm\Syren/libs/Syren.dll.a failed attempt to open C:\Users\camm\Syren/libs/libSyren.a succeeded </code></pre> <p>Hypothesizing that the <code>libSyren.a</code> may be broken, I renamed it to force the linker to use the <code>.dll</code>:</p> <pre><code>attempt to open C:\Users\camm\Syren/libs/libSyren.dll.a failed attempt to open C:\Users\camm\Syren/libs/Syren.dll.a failed attempt to open C:\Users\camm\Syren/libs/libSyren.a failed attempt to open C:\Users\camm\Syren/libs/Syren.lib failed attempt to open C:\Users\camm\Syren/libs/libSyren.dll failed attempt to open C:\Users\camm\Syren/libs/Syren.dll succeeded </code></pre> <p>But I still get exactly the same error messages!</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