Build of wxWidgets app fails - undefined reference to `wxCRT_StrdupA(char const*)' - c++

I was coding a wxWidgets application many days or a week ago, and after the break returned to work today. Before the break, application built and ran successfully, but today ( without changing any code in the project ) I get this build error :
obj\Debug\appwx.o||In function `Z8wxStrdupPKc':|
C:\wxWidgets-3.0.1\include\wx\wxcrtbase.h|679|undefined reference to `wxCRT_StrdupA(char const*)'|
I am using wxWidgets 3.0.1 & CodeBlocks on a Win 7 system.
Obviously during the break I didn't touch that particular project, so the code is same. I did of course search for the solution and found this thread, as well as this thread. Reading them reminded me that I did change a compiler setting meanwhile -> -std=c++11 for gcc to follow the ISO C++11 standard.
I unchecked that option now, but the build error remains.
What do I need to change in the project so that it will build successfully again like it did the last time I was building it ?

You must recompile everything (i.e. both wxWidgets and your application) using the same compiler options and if you use configure to build wxWidgets, you also need to ensure it uses the same options as well.

Related

Windows 10: The application was unable to start correctly (0xc000a200)

I am developing my QT application on windows 10 . The development is complete (as for now).
After run the application in debug mode from QT-creator, I am trying to run the executable from the build directory. But it shows me an "Application Error" dialog with the following message:
The application was unable to start correctly (0xc000a200). Click OK
to close the application.
What is the problem and How to fix it ?!
The error codes are given to you in the error message for a reason. They don't mean anything to regular users, but we're programmers and we are the intended audience. Now that Google has been invented, you have absolutely no excuse for not taking the 5 seconds to Google the error code and see what it means.
In this case, 0xc000a200 is an error code that corresponds to STATUS_NOT_APPCONTAINER. The master list of COM error codes is in the Windows SDK headers, specifically ntstatus.h. If one looks this one up, one sees the following description:
This operation is only valid in the context of an app container.
Now, admittedly, once you get to this point, you may discover that you are in well over your head. You may not have any idea what an app container is, and certainly no clue about how to fix it. But at least then you would be able to ask a good question, which will go a long way to getting you a good answer.
But let's see if you can get lucky this time anyway. This error is most commonly encountered when an application that is not inside of an app container tries to load a DLL that is marked as being part of an app container. It is the linker that is responsible for marking a DLL as being or not being part of an app container, controlled by a series of options for whatever linker you're using. On Microsoft's linker, it is /APPCONTAINER:YES and /APPCONTAINER:NO that control this. I'm not sure what toolchain Qt Creator uses, but if it is not Microsoft's, this should at least get you started looking in the right place in that linker's documentation. Make sure that all DLLs used by your application are not being marked as part of an app container.
The option should be off by default for a regular C++ desktop application project, but it's possible that one of the DLLs started out life as part of a Windows Store app. Or it's possible that the switch just got thrown accidentally.
I had the same error, but the approved solution wasn't the cure. What I found is that I had installed the wrong Qt compiler support packages. For me it was Qt 5.9.1 on Windows 10 64 bit to use with Visual Studio 2017. When installing Qt I selected the "msvc2017 64-bit" option. Sound good, right? Wrong: what I wanted was the "UWP x64 (MSVC2017)".

Netbeans always compiling from the beginning

I'm having a quite big C++ project in Netbeans. It takes about 3 minutes for it to compile (with -j5 mode enabled).
I'm using my VM server (FreeBSD) hosted on Windows 8 and using SFTP option to compile.
Everything is working like a charm except that it looks like Netbeans is always making clean while compiling (no clean messages appearing in the output console though!). It's really annoying for me to wait 3 minutes for each change I have to make in my source code.
My friend had a similar issue some time ago - it was related to the Netbeans timestamps files (different time setting on the local & remote VM machine). In my case the VM machine time setting is the same as on my PC.
I am currently running Netbeans version 7.3.1 (because later & latest version are having some odd SFTP issue not working correctly). I've also tried the latest beta build including earlier versions and it doesn't seem to solve my problem.
Whats the problem? I will appreciate every solution.
There is excellent article "Make Dependency Checking" on this topic by NetBeans team which is worth reading to understand this behaviour.
NetBeans internally uses make utility for dependency checking defined in Makefile. When we create a new project in NetBeans, it enables "Full rebuild" feature. This leads to this particular behaviour.
However if want to avoid this, we can change this particular feature to "Incremental rebuild".
For complete information and to understand its consequences, please refer the above article from NetBeans team.

MinGW w64 with -municode asks for adding 'W' to the end of function name

I'm building a cross-platform application using Qt. Developed on Linux but want to build on Windows, using MinGW-w64. But this compile error happened:
For example, I have a function named func. If adopt the default compile option -municode provided by qmake, gcc says undefined reference to funcW. If manually remove this option, gcc says undefined reference to funcA.
This error only happened for one function, others are fine. That's weird to me though.
Code can be successfully built and compiled on Linux.
Any idea how it happens and how to fix it?

Xcode code sense not working (Symbol not found)

I am new to development on Mac platforms and have recently started using Xcode for development in C++.
Now, whenever I want to look for definition of some class or struct, I click on Jump to definition in the secondary click menu, but Xcode shows up: Symbol not found. The indexing had been completed when I tried to look for definitions. Can anyone provide some solution to the problem?
The version of Xcode that I am using is 4.6 and MAC OS is 10.8.5. This is also happening on Xcode version 4.2 in OS X 10.7.5. Also, the file where I am trying to look for definition is in Objective-C.
I am not sure if this was the root cause of your issue, but this write up helped me:
http://hiltmon.com/blog/2013/07/07/xcode-4-code-completion-for-external-build-projects/
The issues was with the external build project and you can fix it by "including" an additional target.
The answer to your problem is that Xcode isn't very good at this kind of thing yet. Sometimes it seems to work, sometimes it doesn't. It often doesn't work if there is an error in the same file, or if templates are involved (C++). Make sure the build process has completed (e.g. by running or trying to run the application.) And don't disable code sense in the preferences. ;)

Xcode breakpoints only hit when set during debugging

I’m porting a C++ sdk from Windows to Mac OSX 10.5. I have a problem in Xcode where my breakpoints in certain files will only be hit if I set them while debugging. If I stop debugging and then restart, the breakpoints no longer get hit. If I add them while not debugging, they don't get hit. This is only in certain files and my breakpoints are always dark blue. i.e. I can’t tell the difference between a breakpoint that will get hit and one that won’t.
Specifically, my sdk is made up of various dynamic libraries. These are built using Perforce jam, which calls the various compile and link executables depending on my OS and compiler version (such as Visual Studio’s cl.exe and link.exe). I have a simple (unit testing) command line application that links to these dynamic libraries and calls code in them. This application on Windows is a Visual Studio project, in which I set breakpoints on library code and expect them to be hit.
I’ve created the same C++ command line utility application in Xcode 3.1.2 that links to the sdk dylibs and calls code in them. Some of the breakpoints work fine. I can set breakpoints in code that’s called from the troublesome code, and step out to the troublesome code, which I can then step through fine. The troublesome code is compiled into the same dylib as code that works fine. It’s also long and complicated enough not to be a candidate for inlining.
I’ve tried the following:
Turn Load symbols lazily off.
Compile with both gcc 4.0 and gcc 4.2.
Do a full clean and shutdown.
Delete the user-specific files of the xcodeproj package.
Rename the files so they can’t clash with system files.
Clear everything out of the Breakpoints window.
Create a new Xcode project.
My application is compiled in debug with DWARF format and my libraries are built with the –g flag (along with –v, –arch i386 and –fvisibility-inlines-hidden).
Help would be much appreciated. Thanks.
Update: sorry for not updating this, my Mac port project was postponed. I never resolved this, but discovered that it actually only occurs in constructor bodies. I'll revisit this as and when I hit the problem again.
Have you tried these?
Why aren't my breakpoints working?
Not really an answer: You should make a bug report in the official Apple bugtracker. The chances are high that you get an answer sooner or later there - or perhaps it is really a bug.