CodeBlocks not finding wxWidgets - codeblocks

I'm on PopOS and installed wxWidgets via the terminal when I first got the error error: wx/wxprec.h: No such file or directory as said by the user "oBFusCATed". I did not manually compile from source.
wx-config --version outputs 3.0.5
wx-config --cxxflags outputs:
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
wx-config --libs outputs:
-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
I created my project via the wizard and made sure I selected the same version (wxWidgets 3.0.x).
In the step that says "Please select your favorite GUI Builder to use.", I chose wxSmith and Frame based options.
In the next step, which prompts me to choose a compiler, I left it as it was (see image below).
In the next step, which prompts me to select the wxWidgets configuration I selected the following options:
Though, I also tried using the Use default wxWidgets configuration and without any Other Options selected.
And last, I clicked Finish.
In Code::Blocks I've added the `wx-config --cxxflags` and `wx-config --libs` (even two additional ones but with the full path which the commands above return in the terminal), as you can see in the image below.
In the Other compiler options, I have these two lines (which I did not add myself - must've been the wizard):
-Winvalid-pch
-include wx_pch.h
I even added the output of wx-config --cxxflags to Other resource compiler options.
I also added a Global Variable wx with this base path /usr/lib/x86_64-linux-gnu/wx (copy/pasted), as mentioned in step #7 here. If I put the name of the variable exactly as $(#wx), it appears as set___wx__ instead of just wx, as seen in some other instructions I've found here and on other forums/guides.
Interestingly enough, if I click the button on the right to navigate to it, there is no wx folder. Like, it's nowhere to be found. If I were to use my normal file manager, I can navigate to it (terminal works as well). Could this have something to do with it?
In the Linker Settings tab, I've added these two libraries:
At the end of it all, I still get the error mentioned at the beginning. If I were to comment out that line, I get the same error but for wx/app.h and wx/frame.h, which made me think that it's just not finding the wxWidgets, but I can't figure out why.
This is the first time I'm using C++/Code::Blocks/wxWidgets, so if you give me any instructions where I need to put stuff, please, try to be specific.
P.S. Many of the guides on how to set this up seem to be for Windows and the only one I found for Ubuntu (since PopOS is based on it) is this one. Where he even gets the same error, but his solution did not work (add the output of wx-config --cxxflags to Other resource compiler options - which I've already tried - though, he does build from source).
P.S.2. I found this setup build which uses the binary download option, but it's for Windows. Would something mess up if I were to attempt it?
P.S.3. I know a lot of people have similar issues, but the stuff I've already tried seem to have solved their problem and since for me it didn't, I figured I'd ask.

Son of a motherless goat >_<
The moment I ask, an idea popped into my head from another issue I had recently.
I had installed Code::Blocks via the PopShop (i.e. flatpak) and that flatpak had no access to the wx folder, which is why it wouldn't show up when trying to navigate to it via Code::Blocks.
I uninstalled it and installed it again via sudo apt install codeblocks. I created a new project via the wizard (it wouldn't let me select wxSmith because it doesn't seem to come with it - wxSmith plugin is not loaded can not continue) with the same wizard settings mentioned in my original post.
Then I only added the wx-config --cxxflags and wx-config --libs compiler flags and it built!
Darn it, Flatpak...
Anyway, for people that are interested in adding wxSmith plugin, the person in this video shows how.
Run sudo apt install codeblocks-contrib in your terminal and if you had Code::Blocks open, make sure to restart it - and perhaps give the dude a like if the video is still up! :3

Related

Sony Spresense SDK -VS code Extension - Invalid argument # include <arch/types.h> on fresh Build of HelloWorld

Well as life tends to be frustrating, i have found yet another interesting bug in the great conglomerate of which makes up VS-Code and it's list of 'useful' extensions...
Back Story:
To begin - i purchased a new Sony - Spresense Main Board and Expansion Board for development and testing purposes. Everything arrived in great shape with the highest quality of product and packaging.
The First Step:
As with every micro-controller purchased, I always test every aspect offered with the device when it comes to programming. I used the well known Arduino ide to throw a few basic examples on the Spresense main board. They all flashed correctly, worked properly and i was happy to see the device works!
The Problem:
At this point i had gotten my fill of using the arduino ide... I decided to download the vscode extension , following the vscode setup guide provided by Sony Spresense Web Site.
I noted the "setup guide" was using out of date versions from the most up to date available versions.
I tried using the both older and most recent version with same issues.
Every step was followed perfectly and matches the setup guide to the T.
VsCode installs and loads the extension, workspace and workspace configuration properly.
I also followed the instruction for installing the MSYS2 on windows and verified it was working correctly
The All Stop Error:
Excited to see my first hello world printf statment cruise thru the serial terminal i began the project spresense application build.
The Makefile proceeds thru the steps checking directories and performing required duties.
Suddenly towards the end of the make build i get --- BUILD ERROR
make[3]: Entering directory '/c/msys64/home/Anon/spresense/sdk/apps/builtin'
In file included from C:/msys64/home/Anon/spresense/nuttx/include/sys/types.h:47:0,
from C:/msys64/home/Anon/spresense/nuttx/include/nuttx/lib/builtin.h:51,
from ./builtin_list.c:44:
C:/msys64/home/Anon/spresense/nuttx/include/stdint.h:49:12: fatal error: C:/msys64/home/Anon/spresense/nuttx/include/arch/types.h: Invalid argument
include <arch/types.h>
compilation terminated.
ERROR: arm-none-eabi-gcc failed: 1
command: arm-none-eabi-gcc -M -fno-builtin -mabi=aapcs -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Wshadow -Wundef -g -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -I. -isystem /c/msys64/home/Anon/spresense/nuttx/include -isystem /c/msys64/home/Anon/spresense/nuttx/../sdk/include -D__KERNEL__ -pipe -gdwarf-3 -I /c/msys64/home/Anon/spresense/sdk/apps/include ./builtin_list.c
make[3]: *** [/c/msys64/home/Anon/spresense/sdk/apps/Application.mk:209: .depend] Error 1
make[3]: Leaving directory '/c/msys64/home/Anon/spresense/sdk/apps/builtin'
The Make proceeds to throw 10 or so more errors of the same variety, all invalid argument..
I feel like this should be working... I mean with all the fan fair behind this product line one would think the basic setup guide and IDE should work out of the box...
I think i am figuring out why this product line is failing miserably in the public realm...
The Most Basic of Code
#include <sdk/config.h>
#include <stdio.h>
int myAppS_main(int argc, char *argv[])
{
printf("Hello Spresense!!!");
return 0;
}
I have spent a few days trying to make heads or tails of this but from what i can tell, Sony has a broken extension offered thru vscode.
I have to admit i am a bit stumped....
Developing under win10, may try using linux as this appears to be an issue with Win10 using MSYS2 terminal.
I did a same steps with my spresense board, lastweek.
But I did not face this problem...
And I interested of this.
So, if you provide more information, I will investigate it!
Does the file C:/msys64/home/Anon/spresense/nuttx/include/arch/types.h exist? And can you open the file?
What did you choice in SDK Config? (Nothing as default?) If you OK to provide a "sdk.config", could you share it in this page?
Did you use your spresense sdk (/c/msys64/home/Anon/spresense) for another things?(Build check, or configuration or etc...)
What is your MSYS2 version?
And I think, you might can recover your environment with next command, could you try it?
$ cd /c/msys64/home/Anon/spresense/sdk
$ make distclean
Well,
Thanks to #cmm for the confirmation on the build integrity.
I was able to install the dev stack on another windows 10 computer, without the latest feature update. Just to be sure that was not creating an issue.
In my great quest for knowledge, i feel i may have found a solution to my problem after researching this in great length.
What I could verify:
VS Code was fully updated
MSYS2 was properly installed and updated fully from terminal
VS Code extension version is 1.20 updated to current release
Terminal was set in VS Code to MSYS directory and accepted for changes
SDK configuration was default with no additional config options
Project folder location and SDK location are properly set in workspace config
Every step was completed as per the Getting Started with SDK guide described
What I Think Happened
...... Internet Security Program........
During the install of MSYS2 and Vs Code ext i was not paying close attention to the install process. I simply let it run as i went about my work. During this process unbeknownst to me a number of attempts were made and blocked by my firewall and internet security protocols.. I really cannot believe how stupid this whole issue might actually be...
It appears certain sub modules are fetched from different server locations. I checked my firewall logs and for some reason these connection attempts are flagged and blocked.
Always Watch Your INSTALL!!
After whitelisting the flagged connection attempts and full dev stack refresh/re install i was able to build past the issues that plagued me so intensively...
To anyone that encounters this issue, i believe the issue lies in the install process and ensuring proper connections to external servers during MSYS install.
I have to say... This one threw me for one heck of a loop.... :P

How do I create projects on Xcode 7 using wxWidgets?

My specifications are up to date (OS X El Capitan, 10.11). Here are details on what I've tried so far.
I've followed the (Terminal) installation steps included in the wxWidgets download:
mkdir build-cocoa-debug
cd build-cocoa-debug
../configure --enable-debug
make
cd samples; make;cd ..
cd demos; make;cd ..
Then, I followed the wxWidgets wiki guide for creating Xcode projects.
Of course, there were plenty of compilation errors. After taking care of an incorrectly typed include, there were still issues. For the most part, they were undeclared identifiers and incomplete types, but my attention went to one in particular:
"No Target! You should use wx-config program for compilation flags!"
After researching, I believe I need to use wx-config to find what flags to input into the "Other Linker Flags" option in Xcode. However, I can't seem to utilize wx-config in Terminal.
I'm not sure if I'm dealing with the core issue. If I am, how do I use wx-config? And if I'm not, please steer me in the right direction.
Thank you.
*** EDIT: ***
I've used wx-config to find which flags I needed to input into "Other Linker Flags" and "Preprocessor Macros" in Xcode. This significantly reduced the amount of errors and warnings that I was facing.
Unfortunately, these new errors are esoteric to me:
Error/Warning Log
How do I remove these errors so I can run this project?
I'm finally able to compile and run wxWidgets programs using Xcode 7. I've found and followed this awesome guide (of which step 3 seems to now be irrelevant).
In case the link breaks, here is a summary of the steps that helped me:
* * * * * *
Open Terminal and install Homebrew by inputting:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
Then, input:
brew install wxmac
Open Xcode and create a Command Line Tool C++ project.
Back in Terminal, input:
wx-config --libs
Once inputted, copy everything outputted by the Terminal and place it into Other Linker Flags (found in Build Settings of your Xcode project).
At Terminal, input:
wx-config -–cxxflags
Again, copy everything outputted except this time place it into Other C++ Flags (do not erase what is currently in that section).
Then, of course don't forget to include wx/wx.h and don't forget to have at least an empty main function if you want it to run.
* * * * * *
I'm not at a place where I can create Cocoa projects/products, but that's totally fine. I simply wanted a canvas to familiarize myself with the wxWidgets library.
I hope this post will be helpful to others.
Arman,
First couple of questions:
What OS are you trying to compile?
What is your requirements for the minimal OSX version?
I presume you are trying to compile the latest Git HEAD. Please correct me if its not the case.
Now, couple of recommendations:
Try to run "../configure --help" and see at all the different options you can set.
Try to run "../configure --enable-debug --with-mac-osx-version-min=10.x --with-cocoa". This command has to be run after removing the build directory completely and pretending you are starting over.
Try to open the "minimal.xcode" project in the samples/minimnal directory, add the minimal.cpp file to it and compile. If it compiles and runs fine, then you made a mistake setting up the project of your own.
Let us know how it goes.

Could not configure a C compiler (Windows)

On a Windows system, currently I'm trying a waf configure on a directory of code, and it spits out the error "could not configure a C compiler."
Now, I'm 100% certain that I have gcc and g++ installed and in my path because when I type gcc --version, it gives me the current version information. (I'm using mingw and the gcc/g++ are in the /bin subdirectory).
In the author's code directory there is a wscript file which looks like
C_COMPILER = 'gcc-4.7'
CPLUSPLUS_COMPILER = 'g++-4.7'
Now, I have tried changing the strings to simply gcc as well as gcc-4.8.1 (since my current version is 4.8.1), but it still says could not configure compiler.
I tried reading one solution on this same site that looks related, but the solution was on ubuntu and trying to work through those commands didn't help
could not configure a c compiler
I'm at the end of my common sense here after making sure I have gcc and g++ installed, trying different strings in the wscript file trying to get it to recognize I have them installed, and could use some help, thanks.
Edit: I've now tried simply deleting the lines in the wscript file where it changes the compiler name, and suddenly waf configure goes through, but the waf build fails saying things like it can't find really basic things like include vector. The output says it's defaulting to msvs (microsoft visual studio) whereas the author says gcc/g++ is needed; maybe this is the issue but how do I get waf configure/build to use g++/gcc as default?

Can't find file executable in your configured search path for gnc gcc compiler

My problem is that code::blocks error message tells me that it can't find file executable in the search path for gnc gcc compiler. Although, I don't know what that means. Also I typed out some code:
#include <iostream>
using namespace std;
int main(void) {
cout <<"Hello World" <<endl;
return 0;
}
I can't build it or run in code::blocks. What do I need to do?
I went on line but I got some answers that are way over my head. I was able to use code::blocks once before I installed Visual studios express 2013. Visual studios didn't work right either. It kept asking me to repair or uninstall every time I tried to open it. So I deleted it along with code::blocks. Now that I re-installed code::blocks I still can't get to work right.
This problem with compilers is taking up all my time and I can't practice learning programming because I can't get any compiler to work right. I need some help, please.
I'm guessing you've installed Code::Blocks but not installed or set up GCC yet. I'm assuming you're on Windows, based on your comments about Visual Studio; if you're on a different platform, the steps for setting up GCC should be similar but not identical.
First you'll need to download GCC. There are lots and lots of different builds; personally, I use the 64-bit build of TDM-GCC. The setup for this might be a bit more complex than you'd care for, so you can go for the 32-bit version or just grab a preconfigured Code::Blocks/TDM-GCC setup here.
Once your setup is done, go ahead and launch Code::Blocks. You don't need to create a project or write any code yet; we're just here to set stuff up or double-check your setup, depending on how you opted to install GCC.
Go into the Settings menu, then select Global compiler settings in the sidebar, and select the Toolchain executables tab. Make sure the Compiler's installation directory textbox matches the folder you installed GCC into. For me, this is C:\TDM-GCC-64. Your path will vary, and this is completely fine; just make sure the path in the textbox is the same as the path you installed to. Pay careful attention to the warning note Code::Blocks shows: this folder must have a bin subfolder which will contain all the relevant GCC executables. If you look into the folder the textbox shows and there isn't a bin subfolder there, you probably have the wrong installation folder specified.
Now, in that same Toolchain executables screen, go through the individual Program Files boxes one by one and verify that the filenames shown in each are correct. You'll want some variation of the following:
C compiler: gcc.exe (mine shows x86_64-w64-mingw32-gcc.exe)
C++ compiler: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
Linker for dynamic libs: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
Linker for static libs: gcc-ar.exe (mine shows x86_64-w64-mingw32-gcc-ar.exe)
Debugger: GDB/CDB debugger: Default
Resource compiler: windres.exe (mine shows windres.exe)
Make program: make.exe (mine shows mingw32-make.exe)
Again, note that all of these files are in the bin subfolder of the folder shown in the Compiler installation folder box - if you can't find these files, you probably have the wrong folder specified. It's okay if the filenames aren't a perfect match, though; different GCC builds might have differently prefixed filenames, as you can see from my setup.
Once you're done with all that, go ahead and click OK. You can restart Code::Blocks if you'd like, just to confirm the changes will stick even if there's a crash (I've had occasional glitches where Code::Blocks will crash and forget any settings changed since the last launch).
Now, you should be all set. Go ahead and try your little section of code again. You'll want int main(void) to be int main(), but everything else looks good. Try building and running it and see what happens. It should run successfully.
Just open your setting->compiler and click on the reset defaults and it will start work.
* How to Download and install CodeBlocks.* ( I have already downloaded )
***How to solve the CodeBlocks environment error.
Go to "Settings"----"Compiler"----"Selected compiler"( GNU GCC Compiler ).
Then, Selected "Toolchain executables".
Now, "( C:\Program Files (x86)\CodeBlocks\MinGW )"
See Video : https://youtu.be/Tb1VnXs60Lg
I had also found this error but I have solved this problem by easy steps. If you want to solve this problem follow these steps:
Step 1: First start code block
Step 2: Go to menu bar and click on the Setting menu
Step 3: After that click on the Compiler option
Step 4: Now, a pop up window will be opened. In this window, select "GNU GCC COMPILER"
Step 5: Now go to the toolchain executables tab and select the compiler installation directory like (C:\Program Files (x86)\CodeBlocks\MinGW\bin)
Step 6: Click on the Ok.
Now you can remove this error by follow these steps. Sometimes you don't need to select bin folder. You need to select only (C:\Program Files (x86)\CodeBlocks\MinGW) this path but some system doesn't work this path. That's why you have to select path from C:/ to bin folder.
Thank you.
For that you need to install binary of GNU GCC compiler, which comes with MinGW package. You can download MinGW( and put it under C:/ ) and later you have to download gnu -c, c++ related Binaries, so select required package and install them(in the MinGW ). Then in the Code::Blocks, go to Setting, Compiler, ToolChain Executable. In that you will find Path, there set C:/MinGW.
Then mentioned error will be vanished.
Uninstall/Remove your current codeblocks compiler.
Install codeblocks using this link that contains GCC compiler files: http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup-TDM-GCC-481.exe.
Now go to : Settings > Compiler.... > ToolChain Executables Tab
CLICK on Auto-detect button and then click OK button. Now just restart CodeBlocks and start writing your codes and use the Build and run option. It will RUN normally.
Fistly, Code Blocks is not a compiler. It is just an integrated development environment.
So, you must show the path of your compiler at first, (if you dont have a compiler you have to download an install, it is not difficult to find. f.e. GCC is good one.)
If code blocks could not find automatically the path of compiler it is an obligation to show it yourself.
But when you install, probably Code Blocks automatically find your compiler.
Enjoy.
This simple in below solution worked for me.
http://forums.codeblocks.org/index.php?topic=17336.0
I had a similar problem. Please note I'm a total n00b in C++ and IDE's but heres what I did (after some research)
So of course I downloaded the version that came with the compiler and it didn't work. Heres what I did:
1) go to settings in the upper part
2) click compiler
3) choose reset to defaults.
Hopefully this works
I'm a total noob but I reinstalled over the codeblocks giving me these "Can't find file executable in your configured search path for gnc gcc compiler" errors by downloading:
codeblocks-20.03mingw-setup.exe
(IMPORTANT: make sure it has the "mingw" in the file download name, that has the compiler build that is required to compile the code which doesn't automatically comes with the main codeblocks editor software download because codeblocks already assumes you already have another compiler installed on your computer {visual studio 2019 or such}).
Then when I created a new project (console application) and used the defaults to quickly test it out.
It gave me errors.
So I went to Settings > Compiler > Selected Compiler set to: GNU GCC Compiler > Click on the "Tooolchain executables" tab > Click on Auto-Detect > Should say "C:\Progam Files\CodeBlocks\MinGW" > Click OK.
Build and run a simple hello world code.
Should work! If not, look for the "MingGW" in the C:\Program Files\CodeBlocks and select it.
Here's an easy way for Windows users.
Uninstall the existing codeblocks from your system.
Restart system.
Go to http://www.codeblocks.org/downloads/26
Download the codeblocks-16.01mingw-setup.exe file. It includes the GCC/G++ compiler and GDB debugger from TDM-GCC (version 4.9.2, 32 bit, SJLJ).

Why does my Qt 4.5 app open a console window under Windows?

I've been playing around with Qt Creator 4.5 under Linux. My application builds just fine under Linux, but if I build in Windows, the app always opens a console window at startup.
Can I stop it doing that?
I'm building using the default MinGW setup, perhaps that is related. If need be I can build with Visual Studio, but I'd like to understand what is happening first...
Edit: I just created a simple test GUI app with Qt Creator under Windows and it didn't exhibit this behaviour. Either this behaviour has occurred because of the way the project was created under linux, or there is something my app does which causes the console window to appear. Will post details when I diagnose it in case it helps someone else.
For those who have this issue using CMake under Windows (see Amoo's comment), here's a solution here.
In short, you need to add WIN32 to your add_executable() statements:
add_executable(GuiApplication WIN32 src/main.cpp)
For further details, see the CMake documentation on add_executable and WIN32_EXECUTABLE.
The short answer is that including the Qt testlib causes the console to appear. Removing it makes it go away.
To explain further, if your .pro file adds testlib to QT, e.g.
QT += sql \
webkit \
network \
testlib
then the final link step is carried out with a line like this
g++ -enable-stdcall-fixup
-Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc
-mthreads
-Wl
-Wl,-subsystem,console
-o debug\MyApp.exe object_script.MyApp.Debug
-L"c:\Qt\2009.01\qt\lib"
-lglu32 -lgdi32 -luser32 -lQtWebKitd4 -lQtTestd4
-lQtSqld4 -lQtGuid4 -lQtNetworkd4 -lQtCored
We've wound up using the console subsystem! I presume using testlib forces this to happen so that the test output has somewhere to go.
If we now edit the .pro file and remove the reference to testlib and rebuild, we get a link step like this
g++ -enable-stdcall-fixup
-Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc
-mthreads
-Wl
-Wl,-subsystem,windows
-o debug\Ammotin.exe object_script.Ammotin.Debug
-L"c:\Qt\2009.01\qt\lib"
-lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtWebKitd4
-lQtSqld4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
Yay! subsystem is windows, no more console window.
I think that this is not a solution for this specific answer (besides it is 4 years later),
but I think that many people landing in this thread will be looking for this setting:
Projects > Build and Run > Run Settings > Run > [x] Run in terminal
De-select it and run your GUI from QtCreator without an extra Terminal window. Terminal output will be then embedded in the IDE.
You will want to make sure the -mwindows switch is provided.
Edit:
alternatively, you can go into your makefile and add this to your linker flags:
-Wl,-subsystem,windows
Make sure your .pro file doesn't add console to the variable CONFIG. You can do this by adding
CONFIG -= console
somewhere at the end of your .pro file. If CONFIG contains console a window pops up every time you start the program, and this is also used when printing debug output. Thus, adding console can be useful when debugging a program. Otherwise you'd need to use tools like DebugView to show the output of the qDebug() calls.
I use cmake instead of qmake. I used set(CMAKE_CXX_FLAGS "-mwindows")
seems as though
QMAKE_CXXFLAGS +=-mwindows
in your .pro file would do the same.
Sounds like your linker settings are set for a console app. You could try setting the linker to use the /subsystem:windows option. The option for console applications is /subsystem:console. If you build your project in Visual Studio, create a Win32 Project. Don't create a Win32 Console App. The option under Visual Studio for setting the subsystem is under Project Settings->Linker->System->SubSystem. Select Windows(/subsystem:windows).
I took a look into how to do this with MinGW/gcc. The online docs for gcc shows the different options for Windows targets. Like other have stated, the option you are looking for is -mwindows. The option -mwindows creates a windowed app. It seems like your current setting is -mconsole. The option -mconsole produces a console app. This is a linker option. I'm not familiar with Qt Creator but I'm guessing it has a similar way to view project settings like Visual Studio has.
Go to: Projects --> Run and uncheck Run in terminal checkbox
By default the linker assumes you want a console application.
The fix is to add "-mwindows" to your compiler's argument list, and this will also invisibly add the required libraries (-lkernel32, -lgdi32, etc.). You'll probably need to change from main() to WinMain() as the entry point.
RE: your Edit: the Qt build system uses "spec" files to add variables, you can find them in $QTDIR/qt/mkspecs. When you create a new Windows app in QCreator, it sets the default spec to "win32-g++", which automatically sets the correct variables (windows app, linker flags, etc.).
When you made the project under Linux, it used another spec and that caused your issue. You can see the current spec in the "yourproject.pro.user" file.
Qt/2009.05/qt/mkspecs/win32-g++
edit file qmake.conf
modify line
QMAKE_LFLAGS_CONSOLE = -Wl,-subsyetem,console
to
QMAKE_LFLAGS_CONSOLE = -Wl,-subsyetem,windows
and modify your ???.pro file (example add new line or space)
and compiling
it`s working ok

Resources