Cannot open include file: iwscapi.h - windows

I am trying to build an application that requires iwscapi.h. I am getting error:
"Cannot open include file: 'iwscapi.h': No such file or directory".
Below are my includesthat I have used:
#include <stdio.h>
#include <atlbase.h>
#include <atlstr.h>
#include <wscapi.h>
#include <iwscapi.h>
I have added Wscapi.lib in the linker. My build machine is Windows 7 and I am using VS2005 compiler. I manually searched the file iwscapi.h in C drive but it is missing.
Please let me know what causing this error.
Thanks in advance.

Related

How do I correctly set up WXWidgets on Ubuntu? My editor tells me the header files are incorrect

I wanted to try out the WXWidgets Hello World example (https://docs.wxwidgets.org/latest/overview_helloworld.html) so I followed the recommended practice on the Downloads page and installed the WXGTK package for my distribution, Ubuntu, which appears to be libwxgtk3.0-gtk3-dev. After doing this, and copying the example code, g++ (installed from build-essentials) throws an error when I attempt to compile the program:
wxtest.cpp:4:10: fatal error: wx/wxprec.h: No such file or directory
4 | #include <wx/wxprec.h>
| ^~~~~~~~~~~~~
compilation terminated.
My editor (VSCode) also shows me an error: cannot open source file "wx/wxprec.h".
This appears to be related to the fact that the WXWidgets header files are installed to the folder wx-3.0/wx instead of wx, but after changing #include <wx/wxprec.h> to #include <wx-3.0/wx/wxprec.h> I still get an error:
In file included from wxtest.cpp:4:
/usr/include/wx-3.0/wx/wxprec.h:12:10: fatal error: wx/defs.h: No such file or directory
12 | #include "wx/defs.h"
| ^~~~~~~~~~~
compilation terminated.
What am I doing wrong? How can these files be put in the right place?
See the building your project section of the docs.

fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory

I'm working on a car-game project build with unreal engine 4.26, visual studio 2019 pro on win10.
However every time I try to build my project, it yeilds error:
1>C:\CTS6\Source\CarSimulation\SpeechEngine.cpp(11): fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory
Here is my code:
#include "SpeechEngine.h"
#include "SaHinhType.h"
#define _WINSOCKAPI_
#include <windows.h>
#include <sapi.h>
#include <minwindef.h>
#include <atlbase.h>
#include <sphelper.h>
using namespace std;
ISpVoice *voice;
CComPtr<IEnumSpObjectTokens> cpEnum;
CComPtr<ISpObjectToken> cpVoiceToken;
SpeechEngine *SpeechEngine::instance = nullptr;
I've searched around but these suggestion do not solve my problem.
I've install VS Pro from official online installer and I've ticked all 'atl' related components.
Image of installation

Undefined symbol after library search - CLIPPER

I have tried to compile an application written in Clipper 5.2.
It is experiencing an error which I believe is the inclusion of libraries.
The moment that I linked, it displays the following error:
I'm using: rtlink fi MyApp
Stretch of code where I import libraries:
#include "INKEY.CH"
#include "GRUMP.CH"
#include "BOX.CH"
#include "GRUMPBRO.CH"
#include "BOXGET.CH"
REQUEST dbfcdx
function Weekextr()
enter code here
Someone with knowledge clipper could help me?

Trying to include OpenSSL headers in Visual Studio 2012: error LNK2019: unresolved external symbol

I know this problem is pretty common. In fact, I searched a lot about the problem but I can't find any solution which fits my case.
I'm working in a C++ Visual Studio 2012 project which uses openssl libraries.
This is a minimum sample code.
#include <iostream>
#include <stdio.h>
//OpenSSL
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/x509.h>
using namespace std;
int main(){
SSL_library_init ();
return 0;
}
I'm running Visual Studio 2012 Proffesional in a Windows7-64b machine.
I downloaded the Win64 OpenSSL v1.0.1e Light installer from here
and installed it. Then I added to Project Properties-> Configuration Properties-> C/C++-> General-> Additional Include Directories the path "C:\OpenSSL-Win64\include".
So by this moment, the sample code is not showing compilation errors in Visual Studio.
Then, I also added to the Linker-> Additional library directories, the path "C:\OpenSSL-Win64\lib" and then in Linker-> Additional Dependencies, I added "libeay32.lib;" and "ssleay32.lib".
However, when I tried to compile I got this error:
1>------ Build started: Project: Client, Configuration: Debug Win32 ------
1> Client.cpp
1>Client.obj : error LNK2019: unresolved external symbol _SSL_library_init referenced in function _main
1>c:\users\gabi\documents\visual studio 2012\Projects\Project1\Debug\Client.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I also tried with the rest of the OpenSSL libraries, because it's possible that SSL_init_function() doesn't belong to "libeay32.lib" or "ssleay32.lib". So I added in the source code :
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")
#pragma comment(lib, "VC\\libeay32MD.lib")
#pragma comment(lib, "VC\\libeay32MDd.lib")
#pragma comment(lib, "VC\\libeay32MT.lib")
#pragma comment(lib, "VC\\libeay32MTd.lib")
#pragma comment(lib, "VC\\ssleay32MD.lib")
#pragma comment(lib, "VC\\ssleay32MDd.lib")
#pragma comment(lib, "VC\\ssleay32MT.lib")
#pragma comment(lib, "VC\\ssleay32MTd.lib")
Those are all the libraries, except the ones which are in the subfolder "VC\static", because the files in static folder have the same name as some of those and it could be a conflict.
Anyway, the error it's the same.
Oh, I also added the string "C:\OpenSSL-Win64\bin" to the PATH environment variable.
And...I also tried by linking to the Win32 OpenSSL which I installed too, and compiling my own "libeay32.lib" and "ssleay32.lib" following this tutorial. Both, 32b or 64b didn't work.
I'm quite desperate with this, can anyone help me?
Thanks!
I had the problem like yours.
The problem was that my project's platform were for WIN32 but I downloaded OpenSSL x64, so I couldn't call SSL_library_init ();
OpenSSL for Windows (code.google.com)
Hope my answer will help you, even I am late for 2 years :3

stray '#' in program

I want to use NSRunningApplication in my Qt application on Mac OS X.
I tried to include these header files in mainwindow.cpp:
#include Cocoa/Cocoa.h
#include Foundation/Foundation.h
#include AppKit/NSRunningApplication.h
#include AppKit/NSWorkspace.h
#include ApplicationServices/ApplicationServices.h
#include "CGWindow.h".
Also included following in .pro file
INCLUDEPATH += /System/Library/Frameworks/Foundation.framework/Headers
But this gives error: stray '#' in program
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:6,
/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:8 : error: stray '#' in program.
My question is:
How to use NSRunningApplication in my application?
Which file(s) to include and where/how to remove these errors?
You need to make an objc file instead. Change the extension to .mm and use objc directive to import framework:
#import <Foundation/Foundation.h>

Resources