Hello everybody.
The complete error is: "The procedure entry point _Z13qFlagLockationPKc could not be located in the dynamic link library QtCore.dll".
What I'm trying to do is use CodeBlocks with Qt. (if you 're wondering why I'm not using Qt Creator, it's because I have a 'weak' pc and Qt Creator is quite 'heavy').
I make a new project, I choose 'Qt4 Project', it gets created, in some point I was asked for Qt location and I put it (C:\Qt\4.8.5)
and saved it.
But when I tried to build and run it, the above mentioned error appeared!
How can I fix it?
According to this (http://stackoverflow.com/questions/25524620/the-procedure-entry-point-could-not-be-located-in-dynamic-link-library):
QuoteProbably you get this error because you use dlls from QtCreator directory which was not compiled with mingw (often QtCreator compiled with Microsoft visual studio on Windows)
You should use dlls from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin (for example) .
App which was compiled with mingw needs dll which compiled with mingw too.
But I haven't found any mingw folder in C:\Qt\4.8.5. (this is the Qt framework)
But I do have MingW installed in C:\MingW
How can I make CodeBlocks use dlls from C:\MingW? (I guess that's what I'm supposed to do, right?)
As you have found out, the compiler of your app and the compiler of the library have to match. So you need an installation of qt with the right compiler. There are two ways to get the correct library:
1) Use this link for qt 4.8.6 http://download.qt.io/archive/qt/4.8/4.8.6/qt-opensource-windows-x86-mingw482-4.8.6-1.exe
!!! Probably you have also to use mingw 4.8.2 i don't know what version you are using right now..
2) Compile qt by yourself with your compiler: https://wiki.qt.io/Building_Qt_Desktop_for_Windows_with_MinGW
Then you have to specify the right library path in the project assistant. I have never done anything with qt, so i hope other people can help you more here...
greetings.
I did this:
Quote
1) Use this link for qt 4.8.6 http://download.qt.io/archive/qt/4.8/4.8.6/qt-opensource-windows-x86-mingw482-4.8.6-1.exe
!!! Probably you have also to use mingw 4.8.2 i don't know what version you are using right now..
...and also installed this mingw: i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z (https://kent.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z). This was suggestion of Qt installer!
Then in CodeBlocks' Settings -> Compiler->Toolchain executables -> Program Files, I changed:
C Compiler: i686-w64-mingw32-gcc.exe
C++ Compiler: i686-w64-mingw32-g++.exe
Linker For Dynamic libs: i686-w64-mingw32-g++.exe
And worked!!!
Thank you very much for your help BlueHazzard!!
The error appears again... :(
I don't know if this is relevnt, but I mention it: after the successful run in CodeBlocks, I installed in python the package PyQt.
Logically, this is not relevant or connected to Qt Framework or something that has to do with CodeBlocks.
make a fresh rebuild and post the build log here:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
also make sure you have selected the right compiler in your project and in the compiler settings
Does the error appears also if you run your program from within codeblocks?
Quote from: BlueHazzard on January 30, 2017, 08:20:48 PM
make a fresh rebuild and post the build log here:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
also make sure you have selected the right compiler in your project and in the compiler settings
Also, verify that the CB did NOT autodetect an different compiler and change the path to it..
Tim S.
Quote from: BlueHazzard on January 30, 2017, 08:20:48 PM
make a fresh rebuild and post the build log here
I am running Code::Blocks version Code: 16.01 on Windows XP (version 5.1).
The compiler I use is mingw32 version mingw482-4.8.6-1.
When I make a new Qt project and run it, the above mentioned error message appears.
Steps to reproduce problem:
1. in CodeBlocks: File->New Project->Qt4 Project ->Next.
2. Give Project Title->Next.
3. Qt's Location (I give 'C:\Qt\4.8.6')->Next
4. Compiler: GNU/Gcc compiler ->Finish
5. Build->Build and run
6. Appears a message box with the error: "The procedure entry point _Z13qFlagLocationPKc could not be located" etc.
Description of problem: happens anyway I run it: from within CodeBlocks, from the command line and double clicking it.
Build log:
[code]
-------------- Build: Debug in Repairdevices (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -Wall -g -IC:\Qt\4.8.6\include -IC:\Qt\4.8.6\include\QtGui -c "F:\Documents and Settings\Administrator\My Documents\CodeBlocksProjects\Repairdevices\main.cpp" -o obj\Debug\main.o
i686-w64-mingw32-g++.exe -LC:\Qt\4.8.6\lib -o bin\Debug\Repairdevices.exe obj\Debug\main.o -lQtCore4 -lQtGui4
Output file is bin\Debug\Repairdevices.exe with size 154.57 KB
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
Build log saved as:
file://F:/Documents%20and%20Settings/Administrator/My%20Documents/CodeBlocksProjects/Repairdevices/Repairdevices_build_log.html
-------------- Run: Debug in Repairdevices (compiler: GNU GCC Compiler)---------------
Checking for existence: F:\Documents and Settings\Administrator\My Documents\CodeBlocksProjects\Repairdevices\bin\Debug\Repairdevices.exe
Executing: "F:\Program Files\CodeBlocks/cb_console_runner.exe" "F:\Documents and Settings\Administrator\My Documents\CodeBlocksProjects\Repairdevices\bin\Debug\Repairdevices.exe" (in F:\Documents and Settings\Administrator\My Documents\CodeBlocksProjects\Repairdevices\.)
Process terminated with status -1073741510 (0 minute(s), 5 second(s))
Crash report:
CodeBlocks disn't crash, so no RPT was found.
I have already tried reinstalling of Qt 4.8.6 but did not work.
Quote from: BlueHazzard on January 30, 2017, 08:22:55 PM
Does the error appears also if you run your program from within codeblocks?
It appears in every case: when I run it from within CodeBlocks, when I run it from the command line, and when I run it by double clicking it.
Quote from: stahta01 on January 30, 2017, 10:02:38 PM
Also, verify that the CB did NOT autodetect an different compiler and change the path to it..
I looked at Settings->Compiler->Toolchain Executables.
Everything seems as I had set it.
DO a REBUILD and post the build log or be ignored!
EDIT: REBUILD means use rebuild or do a clean followed by a build. It does NOT mean do a build and run!
Tim S.