many stray errors including dll file
-
ok next step is to use any of the functions the DLL provides and see if it will run.
If it really links to the DLL. it should work.Ofc you must remove
#include "wrnx-w32.dll"
its 1000000000% incorrect. :)@mrjj ok
dll's manual say:Common API
Connect to Robot Controllerint krnx_Open(
int cont_no,
char *hostname )Parameters
cont_no
Controller number
hostname
IP address or hostname of the controllerReturns
cont_no : Connected controller number
Negative value : Error code ( refer to chapter 9)Description
Connect to robot controller. After you call this API, you can use other APIs.See also
krnx_CloseSomething like this:
int NC=0; QString HostName = "192.168.1.144" QbyteArray IP = HostName.toLocal8Bit().constData(); int krnx_open(int NC, char *IP);
??
And now?? -
@mrjj ok
dll's manual say:Common API
Connect to Robot Controllerint krnx_Open(
int cont_no,
char *hostname )Parameters
cont_no
Controller number
hostname
IP address or hostname of the controllerReturns
cont_no : Connected controller number
Negative value : Error code ( refer to chapter 9)Description
Connect to robot controller. After you call this API, you can use other APIs.See also
krnx_CloseSomething like this:
int NC=0; QString HostName = "192.168.1.144" QbyteArray IP = HostName.toLocal8Bit().constData(); int krnx_open(int NC, char *IP);
??
And now??@TheCipo76
Call the krnx_open and see if app runs.int krnx_open(int NC, char *IP); <<< this is not calling. but i assume you know that.
krnx_open(NC, IP); // would be calling
and cont_no should be zero ? The first controller is zero ?
-
@TheCipo76
Call the krnx_open and see if app runs.int krnx_open(int NC, char *IP); <<< this is not calling. but i assume you know that.
krnx_open(NC, IP); // would be calling
and cont_no should be zero ? The first controller is zero ?
-
@mrjj Yes, sorry i've forgot this line..
says:
no viable conversion from 'QByteArray' to 'char *'how can i solve??
Yes, first controller must be zero
@TheCipo76 said in many stray errors including dll file:
QByteArray' to 'char *
try
krnx_open(NC, IP.data() ); -
@TheCipo76 said in many stray errors including dll file:
QByteArray' to 'char *
try
krnx_open(NC, IP.data() );@mrjj OMG:
LNK2019: refer to external symbol "int_cdecl krnx_open(int, char ) (?krnx_open @@YAHHPAD@Z) not solved in the function "public:_thiscall MainWindow::MainWindow(class QWidget) (??0MainWindow@@QAE@PAVWidget@@@Z)
mainwindow.obj
LNK1120: 1 extern not solved
-
Hi,
From the name of the dll I would guess that you have a 32bit version. Is it also the case of the Qt version you are using ?
-
Hi,
From the name of the dll I would guess that you have a 32bit version. Is it also the case of the Qt version you are using ?
-
Good, then:
- Which compiler are you using ?
- Which compiler was used for that library ?
-
@SGaist Qt 5.12.5 MSVC 2017 32 bit
C: Microsoft Visual C++ Compiler 15.9.28307.905 (x86)
C++: Microsoft Visual C++ Compiler 15.9.28307.905 (x86)
i've asked to kawasaki which compiler was used to create the dll but they don't reply me yetif i try to compile with MinGW 32 bit
Compiler
C: MinGW 7.3.0 32-bit for C
C++: MinGW 7.3.0 32-bit for C++give me this issue:
undefined reference to krnx_open(int, char*)
-
@SGaist Kawasaki reply:
“
I've taken a look into the lib file and found a "Microsoft link format", so it should be compatible with Microsoft C++ and maybe also with VS C++.
I hope your customer is able to handle around with dll and lib files. To use the dll file correctly, the lib file needs to be statically linked to the project. Maybe your customer forgot about that. If the lib file is correctly linked usually the compiler should be satisfied with the function calls.
If the above don't work, it is possible to guarantee the compatibility with creating a new lib file out of the dll file by a lib-maker tool of VS. I don't know if Microsoft is providing such a tool and have no experience in this, but I did this a long time ago for another project in a Borland C++ programming environment with a Borland tool.
If your customer needs here there is a link that describes the use a dll file in VS (see the second half of the article):
https://docs.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-160
“ -
It would be nice to know which version of VS they have used. Starting with 2017 they now have backward compatibility.