User forums > Using Code::Blocks
RunningTask was not declared in this scope
BlueHazzard:
Now, you can see from this build log that you not arrive to the linking stage. You are still at compiling and try to fix linking problems...
This forum is not the right place for this kind of questions (from the type of: "help get compiler error blabla, what should i do?" This forum is for questions like "Help, i get compiler error blabla and i know this is because i am missing the compiler flag xa. Where do i put this flag?" ) and by this violating the forum rules and probably will get locked. But anyway:
--- Code: ---E:\WorkSpace\Code\TaskScheduler\main.cpp:9:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(lib, "taskschd.lib")
--- End code ---
gcc does not understand the "#pragma comment" and so you should remove all of them. But you should add all this ".lib" entries to
Project->Build options->Select the project name on the left->Linker settings->Additional libraries
--- Code: ---E:\WorkSpace\Code\TaskScheduler\main.cpp:47:5: error: 'ITaskService' was not declared in this scope
ITaskService *pService = NULL;
--- End code ---
Ok, lets google this "'ITaskService' was not declared in this scope"...
according https://msdn.microsoft.com/en-us/library/windows/desktop/aa381832(v=vs.85).aspx this class is declared in taskschd.h . You included this header file but the compiler still can not find this class. I opened the file and searched for this class an can not find it. This sounds like tdm mingw what is shipped with codeblocks does not support this interface. A quick search showed that mingw64 has this interface. So you will need this compiler...
How to set up mingw64 in codeblocks?
I am not on a windows machine so i can not help you here, but generally it should be like this:
1) Install mingw64
2) in codeblocks Settings->Compiler->global compiler settings->Selected compiler->GNU GCC -> copy
3) For the new name enter "mingw64 gcc" -> ok
4)Toolchain executables->Compilers' installation directory -> point to the "bin" directory from the mingw64 installation->Try "auto detect"
5)If it fails you have to put the names of the corresponding executables at the bottom in the "Program Files"
6) Ok
7) Open your project->Project->Build options->On the left select your project name->From the drop down menu on the right top-> Select "mingw64 gcc" -> Ok
8) Build -> Clean
9) Build -> Run
if you have problems after installing mingw64 and setting it up in codeblocks make a new thread (This is the kind of questions this forum is for)
If you have problems after the installation of mingw64 and compiling your project ask again here...
This are all assumption. I can not test them because i do not use windows at the moment and i can not test this....
Cloud_Strife_Han:
Thanks for your clearly and fully helping. I tried following your recomendations but I could not find the class ITaskService in the MinGW64 header :(. What the version of MinGW did you use?
stahta01:
--- Quote from: Cloud_Strife_Han on March 17, 2018, 06:14:48 am ---Thanks for your clearly and fully helping. I tried following your recomendations but I could not find the class ITaskService in the MinGW64 header :(. What the version of MinGW did you use?
--- End quote ---
Please state what version of MinGW GCC you are using?
Please state where you got the MinGW GCC you are using?
Do you understand that MinGW64 is a fork of MinGW GCC from mingw.org?
And, the MinGW64 fork of GCC has more complete headers.
Edit: I have searched my MinGW GCC compilers to see which ones have "ITaskService"
Failed to find it in i686-7.2.0-release-win32-sjlj-rt_v5-rev1 I think other than MSys2 is the only MinGW64 compiler I have
Did find it in MSys2 MinGW64 GCC Compiler.
Edit2: gcc.exe (Rev1, Built by MSYS2 project) 7.3.0
Did not find it in any other of my MinGW GCC Compilers; I think the others are all mingw.org based ones.
Tim S.
BlueHazzard:
@stahta01:
do you have a working msys2 environment with codeblocks? Is it as easy as simply setting the compiler path to the bin folder and all works? Does the msys compiler needs the paths in a msys format? I can not test it at the moment, but i am interested...
stahta01:
--- Quote from: BlueHazzard on March 17, 2018, 09:03:56 am ---@stahta01:
do you have a working msys2 environment with codeblocks?
--- End quote ---
I have set up the normal release Code::Blocks to use the MSys2 mingw64 32-bit GCC compiler.
Not, really did much testing except for building some wxWidgets samples.
Link to CB Projects I used to build wxWidgets sample https://github.com/stahta01/CodeBlocks_UserTemplates_for_MSys2/tree/master/wxwidgets/samples
--- Quote from: BlueHazzard on March 17, 2018, 09:03:56 am ---Is it as easy as simply setting the compiler path to the bin folder and all works?
--- End quote ---
Yes
--- Quote from: BlueHazzard on March 17, 2018, 09:03:56 am ---Does the msys compiler needs the paths in a msys format?
--- End quote ---
No
For a while I used a patch to edit one of the CB variables to MSys2 windows forward slash format.
I am not sure why I needed this; but, it was needed for trying to build CB using that modified CB.
Edit3: I now recall I was trying to use wx-config for building CB; I have since decided this was a bad idea.
--- Quote from: BlueHazzard on March 17, 2018, 09:03:56 am ---I can not test it at the moment, but i am interested...
--- End quote ---
Edit: My patches to use MSys2 shell got to old to maintain. But, it was possible to use MSys2 shell without the patch by using sh.exe and
setting additional path correctly. Did almost no testing of this usage.
Tim S.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version