Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

c++ - How to set up wxWidgets 3.1.0 with Visual Studio 2015

I am somewhat of a beginner when it comes to open source libraries. I have tried to compile from source and use the pre-built binaries, but in both cases I get a ton of errors when I try to run the simple 'Hello World' program on the tutorial section of the wxWidgets website. After playing around for quite some time, the closest I have got to compiling is by building the libraries from source, but I still have 2 errors remaining:

  • "_w64 can only be specified on int, long, and pointer types" file: defs.h
  • "cannot open file 'wxbase31ud.lib" - LINK

It seems strange to me that the header file provided by wx would have an error such as that one, so I imagine both errors are because of something I am doing. I am hoping that someone here can do one of the following for me:

  1. Help me solve these errors
  2. Provide instructions for building libraries from source and subsequently linking my program to the correct directories

Some additional info: I am working on x64 Windows 7, my target will also be x64 exclusively. I do not have admin privileges, so no editing the system PATH for me.

Thanks for your help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The simplest way to start working with the library is this:

  1. Grab the sources.
  2. Unpack the sources.
  3. Open VS IDE.
  4. Open uildmswwx-vc14.sln (adjust as necessary.)
  5. Go to "Build->Batch Build...", click "Select All", "Build".
  6. Go drink some coffee or watch TV.
  7. After the build finishes, open wxWidgets/samples/minimal/minimal_vc9.sln.
  8. Let MSVC convert the solution to become an appropriate format.
  9. Build and run the sample.

If you will acquire any issue during those steps, let us know. The library build in step 5 should build without any issues and then all you will need is to build the minimal sample.

The next step is to copy the samplesminimal folder somewhere and start writing the code. All you will need to do is to change the Include and Lib search path.

[EDIT]

If you can build the 32-bit libraries (which are default in the provided solutions) all you will need is to convert them to be 64-bit and rebuild.

There is no changes to the $PATH or any environmental variable involved. Moreover you shouldn't build anything with the admin priviledges.

Also as Thomas pointed out you library build has to match whatever sample you are trying to build.

[/EDIT]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...