Can't get project started

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
User avatar
RobertWebb
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Oct 29, 2017 11:14 am
Contact:

Can't get project started

Post by RobertWebb »

I want to port some old MFC code to wxWidgets. I'd like to still support XP if possible. I'm using Visual Studio 2015. What I've tried and what went wrong:
  • Tried starting a new empty win32 project, but keep getting this error:

    Code: Select all

    fatal error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
    Bizarre, since I have set up the appropriate additional include directories, which include ".\..\..\wxWidgets\lib\vc_dll\mswud;.\..\..\wxWidgets\include". Yes those paths are right. I also tried absolute paths with same error. I tried copy/pasting this path into the #include itself and then it finds the file, but fails to find another file that it includes. What on Earth is going on?
  • Tried copying the sample project "internat" to another folder and making that work. Updated folders to match etc, and it works, but NOT if I include XP support, ie change Platform Toolset to "Visual Studio 2015 - Windows XP (v140_xp)". Then I get the error

    Code: Select all

    LINK : fatal error LNK1104: cannot open file 'winmm.lib'
    But why should that be missing for XP? It wouldn't normally be.
    Furthermore, if I add XP support to the original sample project in the original sample solution, it works! Why?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Can't get project started

Post by doublemax »

Have you built the wx libraries yourself? If yes, which configurations?
If not, please try to do so. It should work out of the box using the provided solution files.
What on Earth is going on?
wxWidgets needs several paths and preprocessor symbols to be set correctly. I highly recommend to copy one of the samples and start from there in the beginning.
Tried copying the sample project "internat" to another folder and making that work.
What happens if you don't move it and try to build the sample (or any other sample) in its original location?
Use the source, Luke!
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Can't get project started

Post by stahta01 »

What version is your wxWidgets? There was talk about dropping support of XP at some version of wxWidgets.

Tim S.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Can't get project started

Post by doublemax »

stahta01 wrote:What version is your wxWidgets? There was talk about dropping support of XP at some version of wxWidgets
XP is still supported.
Use the source, Luke!
User avatar
RobertWebb
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Oct 29, 2017 11:14 am
Contact:

Re: Can't get project started

Post by RobertWebb »

Using wxWidgets 3.0.3.
doublemax wrote:Have you built the wx libraries yourself? If yes, which configurations?
If not, please try to do so. It should work out of the box using the provided solution files.
Yes built it myself. I went back and built again with the XP platform toolkit too, but made no difference.
wxWidgets needs several paths and preprocessor symbols to be set correctly. I highly recommend to copy one of the samples and start from there in the beginning.
OK that's what I've been doing so far. I just don't understand how it can possibly not find an included file if the path is provided in the properties.
Tried copying the sample project "internat" to another folder and making that work.
What happens if you don't move it and try to build the sample (or any other sample) in its original location?
If I change to support XP, it works in the original samples folder, but not if I copy to another folder. If I don't support XP, it works in both folders.

So how do I support XP in my own folder?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Can't get project started

Post by doublemax »

I can only assume that something went wrong when you changed the project paths.

Try enabling verbose mode in the linker, maybe it shines some light on the topic.
Project properties -> Linker -> General -> Show Progress
Use the source, Luke!
Post Reply