Compiler Error due to Build process
-
Haha I put "~" because I didn't want to show my whole directory structure ;)
Btw, the error code I get is:
Unknown error 0x000000c1.
Which means:0x000000C1
ERROR_BAD_EXE_FORMAT
%1 is not a valid Win32 application.Based on Win32 Error Codes.
This may be relevant. Found a stack post of another person receiving same thing. However, the only answer thought it was a 32/64 bit problem.
Weirdest thing is that the lib is under AMD64 on the repository? Very strange indeed.
Update 21:19:
I have actually made it work, it was due to the compiler being 32 bit, I had to clean and build the project and it worked.@socke said in Compiler Error due to Build process:
I had to clean and build the project and it worked.
Glad you solved the issue. Please don't forget to mark your post as such!
-
@socke said in Compiler Error due to Build process:
I had to clean and build the project and it worked.
Glad you solved the issue. Please don't forget to mark your post as such!
@Pablo-J-Rogina
Hi Pablo, it is not necessarily solved just yet. Until I manage to do a proper function call, then I would say it's solved.
typedef pv_status_t (*pv_porcupine_init)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); pv_status_t pv_porcupine_init = library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); if (status != PV_STATUS_SUCCESS) { qDebug() << "PV_STATUS_SUCCESS"; } }
I am not entirely sure how to do this but I want to load the function pv_porcupine_init().
Based on this tutorial, what does this do exactly? And what is that in my scenario? Is pv_status_t correct in my case?typedef void (*MyPrototype)();
I keep getting:
\main.cpp:81: error: C2440: 'initializing': cannot convert from 'QFunctionPointer' to 'MyPrototype'
-
@Pablo-J-Rogina
Hi Pablo, it is not necessarily solved just yet. Until I manage to do a proper function call, then I would say it's solved.
typedef pv_status_t (*pv_porcupine_init)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); pv_status_t pv_porcupine_init = library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); if (status != PV_STATUS_SUCCESS) { qDebug() << "PV_STATUS_SUCCESS"; } }
I am not entirely sure how to do this but I want to load the function pv_porcupine_init().
Based on this tutorial, what does this do exactly? And what is that in my scenario? Is pv_status_t correct in my case?typedef void (*MyPrototype)();
I keep getting:
\main.cpp:81: error: C2440: 'initializing': cannot convert from 'QFunctionPointer' to 'MyPrototype'
@socke
Hi
The is typedef pv_status_t (*pv_porcupine_init) ...
is the function prototype/definition
pv_status_t pv_porcupine_init (...)
and then we try to bind it to the actual function in the DLL
library.resolve("pv_porcupine_init");so does it go into
if (pv_porcupine_init)
{
<--- ? -
@socke
Hi
The is typedef pv_status_t (*pv_porcupine_init) ...
is the function prototype/definition
pv_status_t pv_porcupine_init (...)
and then we try to bind it to the actual function in the DLL
library.resolve("pv_porcupine_init");so does it go into
if (pv_porcupine_init)
{
<--- ?Hey man, I figured that out.
typedef pv_status_t (*MyPrototype)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); auto pv_porcupine_init = library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); } >> \main.cpp:88: error: C2197: 'void (__cdecl *)(void)': too many arguments for call
Seems as if my typedef declaration is incorrect? From what I can see, it corresponds to the same method in pv_porcupine.h.
-
Hey man, I figured that out.
typedef pv_status_t (*MyPrototype)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); auto pv_porcupine_init = library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); } >> \main.cpp:88: error: C2197: 'void (__cdecl *)(void)': too many arguments for call
Seems as if my typedef declaration is incorrect? From what I can see, it corresponds to the same method in pv_porcupine.h.
-
@mrjj said in Compiler Error due to Build process:
@socke
what is line 88 ?Line 88 would be:
pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle);
-
@socke
maybe the auto dont get it right ?
try with
pv_status_t pv_porcupine_init =
if it complains then try to cast itI did it :D
typedef pv_status_t (*_pv_porcupine_init)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); _pv_porcupine_init pv_porcupine_init = (_pv_porcupine_init) library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; qDebug() << "PV_STATUS_SUCCESS"; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); }
I believe the auto was not casting correctly, I believe (_pv_porcupine_init) fixed it.
Do you know how I know? The compiler said:
[ERROR] loading keyword file #0 failed with 'IO_ERROR'. Which means it called the function and the function returned that error message from my bad input, which is a step forward programmer wise haha -
I did it :D
typedef pv_status_t (*_pv_porcupine_init)(const char *, int32_t, const char *const *, const float *, pv_porcupine_t **); _pv_porcupine_init pv_porcupine_init = (_pv_porcupine_init) library.resolve("pv_porcupine_init"); if (pv_porcupine_init) { pv_porcupine_t *handle; qDebug() << "PV_STATUS_SUCCESS"; pv_status_t status = pv_porcupine_init(model_path, 1, &keyword_path, &sensitivity, &handle); }
I believe the auto was not casting correctly, I believe (_pv_porcupine_init) fixed it.
Do you know how I know? The compiler said:
[ERROR] loading keyword file #0 failed with 'IO_ERROR'. Which means it called the function and the function returned that error message from my bad input, which is a step forward programmer wise hahahi
the most exciting part is if you see the
qDebug() << "PV_STATUS_SUCCESS"; ?Well this has always been a bit hairy, i mean manual resolving function addresses from a DLL :)
-
hi
the most exciting part is if you see the
qDebug() << "PV_STATUS_SUCCESS"; ?Well this has always been a bit hairy, i mean manual resolving function addresses from a DLL :)
@mrjj
Yes, I will mark this as solved now.
However, you do know what is the most pain? I just realized that there exists no free open source trigger word detection repository :( apparently, the audio files you use for Porcupine expires after 30 days, in that sense, it's still free but I don't want to manually update my audio files.Thanks a lot for the help btw.
-
@mrjj
Yes, I will mark this as solved now.
However, you do know what is the most pain? I just realized that there exists no free open source trigger word detection repository :( apparently, the audio files you use for Porcupine expires after 30 days, in that sense, it's still free but I don't want to manually update my audio files.Thanks a lot for the help btw.