<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[32 bit VC library with Qt]]></title><description><![CDATA[<p dir="auto">Hi:<br />
I have this compilation error:</p>
<p dir="auto">widget.obj:-1: error: LNK2019: unresolved external symbol "int __cdecl ReadSymbol(char const *,char const *,void *)" (?ReadSymbol@@YAHPEBD0PEAX@Z)<br />
referenced in function "private: void __cdecl Widget::on_pushButton_clicked(void)" (?on_pushButton_clicked@Widget@@AEAAXXZ)</p>
<p dir="auto">File not found : widget.obj</p>
<p dir="auto">Warning: LNK4272: library machine type 'X86' conflicts with target machine type 'x64'.</p>
<p dir="auto">Basically, i am converting a VS C# code to QT.<br />
here is the .pro file</p>
<pre><code>QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = ttt
TEMPLATE = app


SOURCES += main.cpp\
        widget.cpp

HEADERS  += widget.h

FORMS    += widget.ui

win32:LIBS += -L"$$_PRO_FILE_PWD_/3rdparty/libs/" -lProEasy
</code></pre>
<p dir="auto">here is the header</p>
<pre><code>#ifndef WIDGET_H
#define WIDGET_H

#include &lt;QWidget&gt;

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private slots:
    void on_pushButton_clicked();

private:
    Ui::Widget *ui;
};

#endif // WIDGET_H
</code></pre>
<p dir="auto">here is the main.cpp</p>
<pre><code>#include &lt;Windows.h&gt;
#include "3rdparty/libs/ProEasy.h"

#include "widget.h"
#include &lt;QApplication&gt;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    w.show();

    return a.exec();
}

</code></pre>
<p dir="auto">here is the widget cpp</p>
<pre><code>#include &lt;Windows.h&gt;
#include "3rdparty/libs/ProEasy.h"
#include &lt;stdlib.h&gt;
#include "widget.h"
#include "ui_widget.h"


Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui-&gt;setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    WORD wData[3];



   //ReadSymbol("PC1.#INTERNAL","TestQT_Text",wData);

    INT K;
    K= ReadSym("PC1.#INTERNAL","TestQT_Text",wData);
}

</code></pre>
<p dir="auto">The library i am using is a VC library (3rd party)</p>
<p dir="auto">I had been web searching for a while,  hope some one can provide some guidance.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/72017/32-bit-vc-library-with-qt</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 04:22:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/72017.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Oct 2016 05:53:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 13:54:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kshegunov">@<bdi>kshegunov</bdi></a></p>
<p dir="auto">Ok:</p>
<p dir="auto">That mean compile compile the library in Visual C++ ?</p>
<p dir="auto">As the above codes are with error, aftre built, so I have to get the dll and link again in QT and try to build again?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/post/352373</link><guid isPermaLink="true">https://forum.qt.io/post/352373</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 13:54:12 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 13:06:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ongsk">@<bdi>Ongsk</bdi></a> said in <a href="/post/352355">32 bit VC library with Qt</a>:</p>
<blockquote>
<p dir="auto">Do you mean compile the above ccde? or Just the library?</p>
</blockquote>
<p dir="auto">Both.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ongsk">@<bdi>Ongsk</bdi></a> said in <a href="/topic/72017/32-bit-vc-library-with-qt/12">32 bit VC library with Qt</a>:</p>
<blockquote>
<p dir="auto">One Question: if compiling the library, how do i go about? Any guider?</p>
</blockquote>
<p dir="auto">Depends on the library itself. Refer to the library documentation/site. Build instructions should be present there.</p>
]]></description><link>https://forum.qt.io/post/352357</link><guid isPermaLink="true">https://forum.qt.io/post/352357</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Thu, 06 Oct 2016 13:06:33 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 13:04:58 GMT]]></title><description><![CDATA[<p dir="auto">"First make sure you're compiling everything with the same compiler, then list the symbols (use dependency walker for both) and make sure you have the mentioned symbol there."</p>
<p dir="auto">Do you mean compile the above ccde? or Just the library?</p>
<p dir="auto">One Question: if compiling the library, how do i go about? Any guider?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/post/352355</link><guid isPermaLink="true">https://forum.qt.io/post/352355</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 13:04:58 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 12:49:35 GMT]]></title><description><![CDATA[<p dir="auto">First make sure you're compiling everything with the same compiler, then list the symbols (use dependency walker for both) and make sure you have the mentioned symbol there.</p>
]]></description><link>https://forum.qt.io/post/352345</link><guid isPermaLink="true">https://forum.qt.io/post/352345</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Thu, 06 Oct 2016 12:49:35 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 09:45:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a></p>
<p dir="auto">Well,  Every day I learn something new!</p>
<p dir="auto">there is no dll, only 2 lib files and c++ header. There is one dll but is for dotnet.</p>
]]></description><link>https://forum.qt.io/post/352291</link><guid isPermaLink="true">https://forum.qt.io/post/352291</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 09:45:51 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 09:17:58 GMT]]></title><description><![CDATA[<p dir="auto">images don't work I'm afraid</p>
<blockquote>
<p dir="auto">Qt Creator showed the function as above hence the link is there?</p>
</blockquote>
<p dir="auto">Qt Creator only inspects the headers, it does not check if linking is valid until you try and build</p>
<p dir="auto">One further question, is ProEasy a static or dinamic library? (is there a .dll file?)</p>
]]></description><link>https://forum.qt.io/post/352287</link><guid isPermaLink="true">https://forum.qt.io/post/352287</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Thu, 06 Oct 2016 09:17:58 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 07:45:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kshegunov">@<bdi>kshegunov</bdi></a></p>
<p dir="auto">Hi:<br />
Before I continue to get myself into the "Reading Mess", ha ha.</p>
<p dir="auto">The said library is there, in fact there are 2, (import &amp; export Lib) , also with C++ header :</p>
<p dir="auto">![alt text](<img src="/uploads/files/1475739668834-upload-1a0a3ce2-4d06-4310-af25-d541f378d819-resized.png" alt="0_1475739662553_upload-1a0a3ce2-4d06-4310-af25-d541f378d819" class=" img-fluid img-markdown" /> image url)</p>
<p dir="auto">As you can see as above. Now If i am correct, I read some where in the forum stated that VC Library can be use by just specify the path and use the "Window.h"?</p>
<p dir="auto">![alt text](<img src="/uploads/files/1475739843236-upload-54481e21-097f-4c0b-8caa-c896ec44e00e.png" alt="0_1475739839699_upload-54481e21-097f-4c0b-8caa-c896ec44e00e" class=" img-fluid img-markdown" /> image url)</p>
<p dir="auto">Qt Creator showed the function as above hence the link is there?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/post/352264</link><guid isPermaLink="true">https://forum.qt.io/post/352264</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 07:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 07:34:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ongsk">@<bdi>Ongsk</bdi></a> said in <a href="/post/352257">32 bit VC library with QT</a>:</p>
<blockquote>
<p dir="auto">I am Novice to C++, so please bear with me</p>
</blockquote>
<p dir="auto">Oookay. I'll explain shortly and give you links to read further.</p>
<p dir="auto">The source code you write goes through several transformations before it becomes a program that is executed, namely: compiling<a href="https://en.wikipedia.org/wiki/Compiler" target="_blank" rel="noopener noreferrer nofollow ugc">[1</a>, <a href="https://en.wikipedia.org/wiki/Translation_unit_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">2]</a>, linking<a href="https://en.wikipedia.org/wiki/Translation_unit_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">[2</a>, <a href="https://en.wikipedia.org/wiki/Linker_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">3]</a> and ultimately loading<a href="https://en.wikipedia.org/wiki/Loader_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">[4]</a> (in that order). The <a href="https://en.wikipedia.org/wiki/Compiler" target="_blank" rel="noopener noreferrer nofollow ugc">compiler</a> produces <a href="https://en.wikipedia.org/wiki/Translation_unit_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">translation units</a> (also called obj files) from your source code. On the next step those <a href="https://en.wikipedia.org/wiki/Translation_unit_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">object files</a> are <em>"stitched"</em> together by the <a href="https://en.wikipedia.org/wiki/Linker_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">linker</a> to produce a binary image (either an executable file or a dynamic library). When you start the program <a href="https://en.wikipedia.org/wiki/Loader_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">the loader</a> starts reading the binary and starts to assign addresses in memory to the <a href="https://en.wikipedia.org/wiki/Symbol_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">symbols</a> contained therein. Each function or a global variable will ultimately produce a symbol entry in the binary image (there are some conditions for this but they're unimportant here).</p>
<p dir="auto">So, each of these steps to arrive to a working program are performed by a program. Compilation is done with the help of a <a href="https://en.wikipedia.org/wiki/Compiler" target="_blank" rel="noopener noreferrer nofollow ugc">compiler</a>. Linking is done by the <a href="https://en.wikipedia.org/wiki/Linker_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">linker</a>. While <a href="https://en.wikipedia.org/wiki/Software_build" target="_blank" rel="noopener noreferrer nofollow ugc">building</a> (the process of going through all the mentioned steps) the different tools are called with arguments. What we refer to as <em>"compile line"</em> is the command that's executed for <a href="https://en.wikipedia.org/wiki/Compiler" target="_blank" rel="noopener noreferrer nofollow ugc">compilation</a>, the link line respectively is the command and arguments that is executed for the purposes of <a href="https://en.wikipedia.org/wiki/Linker_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">linking</a>.</p>
<p dir="auto">For example this is a real-life compile line (from a project of mine):</p>
<pre><code>g++ -c -include .pch/Qt5Daemon -pipe --pedantic-errors -g -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_TSLIB -DQT_NO_FOREACH -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_BUILD_DAEMON_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_DBUS_LIB -DQT_CORE_LIB -I. -I. -I../../include -I../../include/QtDaemon -I../../include/QtDaemon/1.0.0 -I../../include/QtDaemon/1.0.0/QtDaemon -I/home/nye/Programming/C++/qt/5.6/include -I/home/nye/Programming/C++/qt/5.6/include/QtDBus -I/home/nye/Programming/C++/qt/5.6/include/QtCore -I.moc -I/home/nye/Programming/C++/qt/5.6/mkspecs/linux-g++ -o .obj/controllerbackend_linux.o controllerbackend_linux.cpp
</code></pre>
<p dir="auto">While this is the link line:</p>
<pre><code>g++ -Wl,--no-undefined -Wl,--version-script,QtDaemon.version -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5Daemon.so.1 -o libQt5Daemon.so.1.0.0 .obj/qdaemonapplication.o .obj/qdaemonlog.o .obj/qdaemoncontroller.o .obj/qabstractdaemonbackend.o .obj/qdaemonstate.o .obj/qdaemoncontroller_linux.o .obj/qdaemondbusinterface.o .obj/qdaemon.o .obj/qdaemon_linux.o .obj/controllerbackend_linux.o .obj/daemonbackend_linux.o .obj/qrc_qdaemon.o .obj/moc_qdaemonapplication.o .obj/moc_qdaemoncontroller.o .obj/moc_qdaemondbusinterface_p.o .obj/moc_daemonbackend_linux.o  -L/home/nye/Programming/C++/qt/5.6/lib -lQt5DBus -lQt5Core -lpthread
</code></pre>
<p dir="auto">Both of these can be seen in Qt Creator's <em>"Compile output"</em> pane. The link line is the last <code>g++</code> call (the linker may be called differently on different OSes), and I know it's linking because there is no <code>-c</code> flagged passed that'd signify compilation.</p>
<blockquote>
<p dir="auto">Do I need to compiled it?</p>
</blockquote>
<p dir="auto">Now, any external (dynamic) library you <em>"link"</em> needs to be compiled beforehand. So yes, you need to compile it or otherwise obtain the binary image for said library. Since you're using <code>qmake</code> as an intermediary for building (it's just a tool that simplifies the whole process described above) you have to make sure you have <code>libProEasy.lib</code> or <code>ProEasy.lib</code> located in <code>$$_PRO_FILE_PWD_/3rdparty/libs</code> (that's what <code>win32:LIBS += -L"$$_PRO_FILE_PWD_/3rdparty/libs/" -lProEasy</code> means).</p>
<p dir="auto">After that symbols and flavor (x86 vs x64) can be inspected with the help of yet another tool - dependency walker. But first thing's first - make sure you have the <code>.lib</code> file at the specified location.</p>
<p dir="auto"><a href="https://en.wikipedia.org/wiki/Compiler" target="_blank" rel="noopener noreferrer nofollow ugc">[1]: https://en.wikipedia.org/wiki/Compiler</a><br />
<a href="https://en.wikipedia.org/wiki/Translation_unit_(programming)" target="_blank" rel="noopener noreferrer nofollow ugc">[2]: https://en.wikipedia.org/wiki/Translation_unit_(programming)</a><br />
<a href="https://en.wikipedia.org/wiki/Linker_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">[3]: https://en.wikipedia.org/wiki/Linker_(computing)</a><br />
<a href="https://en.wikipedia.org/wiki/Loader_(computing)" target="_blank" rel="noopener noreferrer nofollow ugc">[4]: https://en.wikipedia.org/wiki/Loader_(computing)</a></p>
]]></description><link>https://forum.qt.io/post/352262</link><guid isPermaLink="true">https://forum.qt.io/post/352262</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Thu, 06 Oct 2016 07:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 07:08:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a></p>
<p dir="auto">I am Novice to C++, so please bear with me:</p>
<p dir="auto">I thought just by including the lib file, I am able to use the function? In fact the intellisense of QT Creator did show the function.</p>
<p dir="auto">Do I need to compiled it?</p>
<p dir="auto">By the way what is Link Line?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/post/352257</link><guid isPermaLink="true">https://forum.qt.io/post/352257</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 07:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 07:02:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ongsk">@<bdi>Ongsk</bdi></a> said in <a href="/post/352249">32 bit VC library with QT</a>:</p>
<blockquote>
<p dir="auto">Any Idea?</p>
</blockquote>
<p dir="auto">I don't see a link line. After you extract the linker command do just what <a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> said: make sure the linked libraries (as per the link line) are compiled and linked with the same versions of the tools and are the same flavor (32bit vs 64 bits). After that make sure <code>ReadSym</code> is exported.</p>
]]></description><link>https://forum.qt.io/post/352256</link><guid isPermaLink="true">https://forum.qt.io/post/352256</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Thu, 06 Oct 2016 07:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 06:50:57 GMT]]></title><description><![CDATA[<ul>
<li>was ProEasy compiled for 32 or 64 bit?</li>
<li>does ProEasy export ReadSym function?</li>
</ul>
]]></description><link>https://forum.qt.io/post/352251</link><guid isPermaLink="true">https://forum.qt.io/post/352251</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Thu, 06 Oct 2016 06:50:57 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 06:42:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kshegunov">@<bdi>kshegunov</bdi></a></p>
<p dir="auto">Hi:<br />
Even I use the absolute path, I am having the same problem as above. Any Idea?</p>
]]></description><link>https://forum.qt.io/post/352249</link><guid isPermaLink="true">https://forum.qt.io/post/352249</guid><dc:creator><![CDATA[Ongsk]]></dc:creator><pubDate>Thu, 06 Oct 2016 06:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to 32 bit VC library with Qt on Thu, 06 Oct 2016 05:56:04 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
Please provide the link line from the building. It appears your library isn't linked, thus you get the unresolved external symbol. Why use <code>$$_PRO_FILE_PWD_</code> at all? I'd recommend just a relative path, e.g: <code>-L../3rdparty/libs</code></p>
<p dir="auto">Kind regards.</p>
]]></description><link>https://forum.qt.io/post/352235</link><guid isPermaLink="true">https://forum.qt.io/post/352235</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Thu, 06 Oct 2016 05:56:04 GMT</pubDate></item></channel></rss>