error while building a Hello World wxwidgets app with visual studio 2019 - c++

I'm trying build wxwidgets Hello World sample program in visual studio and i'm using prebuilt wxwidgets instead download that and build it myself.
and after configuring visual studio project for wxwidgets i always facing with this error:
Error C1083 Cannot open include file: '../../../lib/vc142_x64_dll/mswud/wx/setup.h': No such file or directory wxwidgets_programming_cpp C:\wxwidgets\include\msvc\wx\setup.h 140
where is the problem. I think i configured visual studio project in a wrong way. can you help me how to configure visual studio project for a regular wxwidgets app?

You need to define wxMSVC_VERSION_ABI_COMPAT in the preprocessor definitions to use these binaries, which will result in using the correct vc14x prefix instead of vc142 used by default. This is already supposed to be done by wxwidgets.props, at least for the DLL configuration which you seem to use, so I am not sure why it doesn't work for you if you do use this file, but at any rate this symbol must be defined and it isn't in your case.

Related

FLTK on Visual Studio 2019 x64, "Cannot open include file: 'dirent.h': No such file or directory

I am using the FLTK library in Visual Studio Community 2019 and building my application for x86 works fine. Now, I would like to build it for x64. However, I am getting the error "Cannot open include file: 'dirent.h': No such file or directory.".
The error occurs in the file, named 'filename.H'. This header file comes with the FLTK library.
Has anyone an idea how I could fix this problem?
Update:
The dirent.h library is not recognized, because its an C POSIX library, as described in the link here below. However, the question still remains, namely, how can I fix this problem?
<dirent.h> in visual studio 2010 or 2008
The link above refers to a link with an alternative dirent.h file. I've tried to include this file in my project, however, now another errors occur. These errors occur in the file Fl_Native_File_Chooser.H. The type specifiers fl_OPENFILENAMEW and fl_BROWSEINFOW are unknown in this file.
On Windows, dirent.h should not be included in the FLTK code. Even though it is 64 bit, WIN32 must be defined when using the FLTK libraries (https://www.fltk.org/doc-1.3/preface.html). Your problem will probably be solved if you define WIN32 at the beginning of your code or if you add WIN32 in your Visual Studio project properties - C/C++ - Preprocessor - Preprocessor Definitions, in x64 platform.
The way I would create an x64 solution is
Open ide\VisualC2010\fltk.sln
If you are using another version of Visual Studio, let it convert.
Change the solution configuration to Debug (somehow Visual Studio always defaults to Debug Cairo)
Click on solution platforms and select Configuration Manager
When the Configuration Manager appears, under Active solution platforms select New
When the next dialog appears, under type or select new platforms select x64
Click on the OKs etc to close the windows
Now change the solution platform to x64 and start the build.
You shouldn't get any dirent.h errors.

TightVNC on VS2015 compile from source code

I am trying to compile the TightVNC from the source code.
Here is my system details:
Windows 10
SDK 8.1
When i build the project it throw error about the folder or file not found. I try to install and include the files but it won't worked.
sidenote: I am not a C++ developer, i have to compile it from source code.
Thanks in advance.
The error
RC1015 can't open include file afxres.h
seems to generate from project because it requires the header file from MFC. As far as I understand, visual studio 2015 default setup does not install Visual C++ MFC package. Therefore you need to modify the Visual Studio 2015 setup and add the MFC.
Please close VS2015 and Go To
Control Panel->Programs and Features->
Microsoft Visual Studio <Professional/Enterprise>->
Change->Modify->Add Microsoft Foundation Classes
Then re-open visual studio 2015 and re-build the solution.

How to compile source C++ code that doesn't have a project file?

I have just started learning more about C/C++ and I am using Visual Studio 2013 to manage the code.
A project I am working on to use the Tobii EyeX eye gaze system requires me to be able to tweak this code slightly, however I do not understand how I can compile this code to an exe file without a Microsoft Visual Studio project file. This is that code:
https://github.com/MastaLomaster/bkb
In the source folder you see all the project's files but not an actual project file. How would I go about compiling this code? Where do I start? I can not seem to be able to load this is Visual Studio at all - the programmer of the code says (at the bottom of the Github page):
Compiling the source codes As for now, you have to use Microsoft
Visual Studio 2012 (latest update preferred)...
Either create a makefile(if no makefile is exist) for visual studio using nmake or you can use the suggestion provided in this link.
Additionally you can create a project by adding these codes as source. follow this link.

Visual Studio 2010 can't find iostream

I just installed Visual Studio 2010, and wanted to test it out by writing a hello world application.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
After trying to compile this I get this error
error C1083: Cannot open include file: 'iostream': No such file or directory
Here are my visual studio include directories
$(VCInstallDir)include; $(VCInstallDir)atlmfc\include; $(WindowsSdkDir)include; $(FrameworkSDKDir)\include;
And my library directories
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib
If you are unable to build a simple hello world application then it suggests that either Visual Studio or the Windows SDK isn't installed correctly. Have you downloaded and installed the Windows SDK? (note: if you need to build for XP you might need to use the Win7 SDK instead)
I seem to recall that after installing the Windows SDK you may need to 'integrate' it for use with VS2010. Each version of Visual Studio can have a different default SDK that it builds against. You may need to run the SDK Configuration Tool to register it for use with VS2010. Alternatively, you might need to check the 'Platform Toolset' settings in the project, as described here
Ultimately, once that is correctly setup then you should be able to build simple C++ apps without any further configuration.
The pages given below may help you:
1.) http://msdn.microsoft.com/en-us/library/8z9z0bx6.aspx
2.) http://msdn.microsoft.com/en-US/library/hdkef6tk.aspx
<iostream> is normally stored in the C:\Program Files\Microsoft Visual Studio 10\VC\include folder. First check if it is still there.
the /P compiler option is uese to preprocess helloWorld.cpp(say),this will generate helloWorld.i, and then you check to see where iostream is getting included.
and the builded log should be helpful as well as using the /showincludes option to show the paths to the include files.
Go through the normal easy process of creating a new Project --> Templates: Visual C++ --> Win32 Console Application. If not, search your HDD for iostream and set the include path manually.

OpenGL: How to compile glew32.dll from source file

I download the glew source file from http://glew.sourceforge.net/.
In the readme file, it says I should use \build\vc6.0\glew.dsw to comple the DLL.
But there are four projects after I open it in VS 2010.
When I compile them, 2 of them failed to compile.
Thanks.
Ok.
I figured it out.
Just open the the file in glew.dsw in VS 2010.
There are four projects.
Compile glew_shared, you will get glew32d.dll.
Compile glew_static, you will get glew32d.lib.
just ignore the other two.
glew32d.dll and glew32d.lib works fine in VS 2010.
This also answer my own question in
Glew in VS 2010: unresolved external symbol __imp__glewInit
Just a guess but by the way that folder is labelled, it's probably meant to compile using Visual C++ 6.0, which came with Visual Studio 6. I just gave it a quick try and built without problems under that IDE. Of course, I don't believe Microsoft offers that product anymore. If you want to build it yourself, you'll probably have to upgrade the code base to Visual C++ 2010.
I ran into the same problem. I converted the original project to Visual Studio 2010 and placed the result in https://github.com/chrisoei/glew. See the downloads section for a zip file containing glew32.dll built using VS 2010.