Fatal error windows h no such file or directory


0

3

Установил Qt 5.4.2.

При компиляции своей прграммы имею следующую ошибку:

/opt/Qt_5_4_2/5.4/gcc/include/QtCore/qt_windows.h:63:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
Makefile:20184: recipe for target 'build/qtlockedfile_win.o' failed
make: *** [build/qtlockedfile_win.o] Error 1
00:25:15: Процесс «/usr/bin/make» завершился с кодом 2.

Эту ошибку вызывает следующий код в файле gcc/include/QtCore/qt_windows.h:

...
#ifndef NOMINMAX
#  define NOMINMAX
#endif
#include <windows.h>

#if defined(_WIN32_IE) && _WIN32_IE < 0x0501
#  undef _WIN32_IE
#endif
#if !defined(_WIN32_IE)
#  define _WIN32_IE 0x0501
#endif

#ifdef _WIN32_WCE
#include <ceconfig.h>
#endif
...

На этом знакомство с Qt 5.4.2 пока что прекратилось. Как-нибудь можно исправить это недоразумение?

ОС Debian Stable.

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

  1. 08-21-2006


    #1


    Codigious


    windows.h no such file or directory

    I am working on getting a new compiler and the one im looking at is MVC(not sure if the ++ are included on the end lol). Anyways, my current compiler is Dev 4.9.2 and it compiles and runs my program just fine. But when I moved the code over to the MVC and tried it, it didnt work. I got the same error multiple times. So then I downloaded Platform SDK and added in the lib,bin and include files I was supposed to. I also changed a line of code that had kerbel.lib or something like that on it(which I was supposed to do). And I still cant get it to work.

    here is the error message:

    Code:

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

    This is how I used it in the actual code:

    Code:

    #include <iostream>
    #include <windows.h>

    I tried changing windows.h to windows and that didnt work either. So im nnot really sure wat else to do. If someone could explain to me why it doesnt work and/or how to fix it that would be great.

    Last edited by FingerPrint; 08-21-2006 at 04:46 AM.

    Code:

    /* ------------------------------------------------------------------*/
                               // INSERT CODE HERE
    /* ------------------------------------------------------------------*/


  2. 08-21-2006


    #2


    Registered User


    did you follow all the installation steps ?


  3. 08-23-2006


    #3


    Codigious


    I didn’t see step 5 the first time through(I was in a hurry and didnt scroll down that far). Anyways, I commented out the for lines that it says t comment out. Then it says:

    Code:

    From the File menu, click New Project. In the New Project dialog box, 
    expand the Visual C++ node in the Product Types tree and then click 
    Win32. Click on the Win32 Console Application template and then give 
    your project a name and click OK. In the Win32 Application Wizard 
    dialog box, make sure that Windows application is selected as the 
    Application type and the ATL is not selected. Click the Finish button 
    to generate the project.

    Code:

    In the Win32 Application Wizard dialog box, make sure that Windows 
    application is selected as the Application type 
    
    /* On this part it wont let me select windows application. 
    Only console application. */

    I did exactly what it said but cant finish it because I cant make a windows app. And I have no idea why I cant.

    Code:

    /* ------------------------------------------------------------------*/
                               // INSERT CODE HERE
    /* ------------------------------------------------------------------*/


  4. 08-23-2006


    #4


    (?<!re)tired


    If you were in a hurry then, double check now if you have the needed paths on the include list.

    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


  5. 08-24-2006


    #5


    Codigious


    Well, I’m glad you said that mario. I did add the paths I was supposed to add, but I added all 3 of them into the executables. I fixed that part. But I still got the error when I ran my program, and I still cant make a windows app. I still can only make a console app.

    I also just noticed another thing. On the page Ancient Dragon pointed out says to comment out lines 441-444

    Code:

    // WIN_APP.disabled = true;
    // WIN_APP_LABEL.disabled = true; 
    // DLL_APP.disabled = true; 
    // DLL_APP_LABEL.disabled = true;

    in C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\103 3. I went there, opened the file in Notepad(it mentioned opening it in a text editor) and looked for the 4 lines. Well, I only found these 3 lines.

    Code:

    // WIN_APP.disabled = true;
    // DLL_APP.disabled = true;
    // LIB_APP.disabled = true;

    So, should I just replace the 3 lines I have with the 4 lines it says should be commented out. Or could this really screw up the program?

    EDIT: Ok cool. I found the 4 lines. I didnt notice them the first few searches. But I just found them and commented them out. Its working a’ok now.

    RE-EDIT!: Bah! Ok, I thought it was working but unfortunately it isnt. I can now make windows apps and dll’s. Yet it still says that there is no winows.h. I just dont get it, ive done all the install steps. All the other headers work just fine. I dont know what else to do from here. It works just fine in Dev C++. Is there some stupidly obvious lib im supposed to add or something?

    Last edited by FingerPrint; 08-24-2006 at 04:43 PM.

    Code:

    /* ------------------------------------------------------------------*/
                               // INSERT CODE HERE
    /* ------------------------------------------------------------------*/


  6. 08-24-2006


    #6


    Codigious


    Well, I did a google search and it seems a ton of people are having this problem. Ill keep working at it but I think I might as well go back to Dev C++ or find some other compiler. Thanks for the help though.

    Code:

    /* ------------------------------------------------------------------*/
                               // INSERT CODE HERE
    /* ------------------------------------------------------------------*/


  7. 08-26-2006


    #7


    Registered User


    Allright, I think I figured out the problem; It is with microsoft’s website itself; The paths that they provide are inaccurate; It says:

    Code:

    Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.
    
    Add the paths to the appropriate subsection:
    
    Executable files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin
    
    Include files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
    
    Library files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib

    But it should actually say:

    Code:

    Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.
    
    Add the paths to the appropriate subsection:
    
    Executable files: C:\Program Files\Microsoft Platform SDK\Bin
    
    Include files: C:\Program Files\Microsoft Platform SDK\Include
    
    Library files: C:\Program Files\Microsoft Platform SDK\Lib

    At least that worked for me; But if that doesn’t work for you, all you have to do is when you are adding a path, instead of copying and pasting the path, click on the «…» button at the end of the box and then browse to the directory that Microsoft PSDK is saved at, then doubleclick on «Bin», «Include», or «Lib» depending on what path you are changing; This should work;


  8. 08-26-2006


    #8


    Registered User


    The #include <windows.h> not working problem…SOLVED!

    Okay, I have noticed a lot of people having this problem(myself included), on this board, and all accross google; I think that I have discovered the error though; The error is with microsoft’s «using platform sdk with visual c++» instruction page, which is located at http://msdn.microsoft.com/vstudio/ex…k/default.aspx; The paths that they provide are inaccurate; It says:

    Code:

    Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.
    
    Add the paths to the appropriate subsection:
    
    Executable files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin
    
    Include files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
    
    Library files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib

    But this is incorrect; It should actually say:

    Code:

    Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.
    
    Add the paths to the appropriate subsection:
    
    Executable files: C:\Program Files\Microsoft Platform SDK\Bin
    
    Include files: C:\Program Files\Microsoft Platform SDK\Include
    
    Library files: C:\Program Files\Microsoft Platform SDK\Lib

    If that doesn’t work for you, all you have to do is when you are adding a path, instead of copying and pasting the path, click on the «…» button at the end of the box and then browse to the directory that Microsoft Platform SDK is saved at, then doubleclick on the folder named «Bin», «Include», or «Lib», depending on what path you are changing; This worked for me, so chances are it will also work for you;


  9. 08-26-2006


    #9


    C++ Witch


    Interesting. I installed Platform SDK, and the correct path is what is given by Microsoft’s directions. Which version of the PSDK did you download and install?

    Originally Posted by Bjarne Stroustrup (2000-10-14)

    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. «Finding the smallest program that demonstrates the error» is a powerful debugging tool.

    Look up a C++ Reference and learn How To Ask Questions The Smart Way


  10. 08-26-2006


    #10


    Registered User


    Originally Posted by laserlight

    Interesting. I installed Platform SDK, and the correct path is what is given by Microsoft’s directions. Which version of the PSDK did you download and install?

    the at this address http://www.microsoft.com/downloads/d…displaylang=en


  11. 08-26-2006


    #11


    C++ Witch


    Then you probably downloaded the old version. The new version is also linked to from there, under the «Related Resources» section.

    Originally Posted by Bjarne Stroustrup (2000-10-14)

    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. «Finding the smallest program that demonstrates the error» is a powerful debugging tool.

    Look up a C++ Reference and learn How To Ask Questions The Smart Way


  12. 08-26-2006


    #12


    Registered User


    Ah…Oh, well then I should prolly see about deleting this thread… God, I feel a little dumb now…Lol;


Реализация DI в PHP

Jason-Webb 13.05.2025

Когда я начинал писать свой первый крупный PHP-проект, моя архитектура напоминала запутаный клубок спагетти. Классы создавали другие классы внутри себя, зависимости жостко прописывались в коде, а о. . .

Обработка изображений в реальном времени на C# с OpenCV

stackOverflow 13.05.2025

Объединение библиотеки компьютерного зрения OpenCV с современным языком программирования C# создаёт симбиоз, который открывает доступ к впечатляющему набору возможностей. Ключевое преимущество этого. . .

POCO, ACE, Loki и другие продвинутые C++ библиотеки

NullReferenced 13.05.2025

В C++ разработки существует такое обилие библиотек, что порой кажется, будто ты заблудился в дремучем лесу. И среди этого многообразия POCO (Portable Components) – как маяк для тех, кто ищет. . .

Паттерны проектирования GoF на C#

UnmanagedCoder 13.05.2025

Вы наверняка сталкивались с ситуациями, когда код разрастается до неприличных размеров, а его поддержка становится настоящим испытанием. Именно в такие моменты на помощь приходят паттерны Gang of. . .

Создаем CLI приложение на Python с Prompt Toolkit

py-thonny 13.05.2025

Современные командные интерфейсы давно перестали быть черно-белыми текстовыми программами, которые многие помнят по старым операционным системам. CLI сегодня – это мощные, интуитивные и даже. . .

Конвейеры ETL с Apache Airflow и Python

AI_Generated 13.05.2025

ETL-конвейеры – это набор процессов, отвечающих за извлечение данных из различных источников (Extract), их преобразование в нужный формат (Transform) и загрузку в целевое хранилище (Load). . . .

Выполнение асинхронных задач в Python с asyncio

py-thonny 12.05.2025

Современный мир программирования похож на оживлённый мегаполис – тысячи процессов одновременно требуют внимания, ресурсов и времени. В этих джунглях операций возникают ситуации, когда программа. . .

Работа с gRPC сервисами на C#

UnmanagedCoder 12.05.2025

gRPC (Google Remote Procedure Call) — открытый высокопроизводительный RPC-фреймворк, изначально разработанный компанией Google. Он отличается от традиционых REST-сервисов как минимум тем, что. . .

CQRS (Command Query Responsibility Segregation) на Java

Javaican 12.05.2025

CQRS — Command Query Responsibility Segregation, или разделение ответственности команд и запросов. Суть этого архитектурного паттерна проста: операции чтения данных (запросы) отделяются от операций. . .

Шаблоны и приёмы реализации DDD на C#

stackOverflow 12.05.2025

Когда я впервые погрузился в мир Domain-Driven Design, мне показалось, что это очередная модная методология, которая скоро канет в лету. Однако годы практики убедили меня в обратном. DDD — не просто. . .

Hi,

I have this code in C++ and it is not compiling in a terminal window on a Fedora Linux machine.

Please help, thanks a lot

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
    LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
    return 0;
}

jencas

This is Windows code, not Linux.

This is Windows code, not Linux.

Hi,

Thanks a lot for the reply, I am sorry to post the code since I am not aware of the fact that it belongs to Windows, Could you please tell me as to what I should do in order to find code that has buttons etc and can work in Linux terminal?

Any particular web site or books for the purpose?

Thanks a lot my friend for your time, appreciated………

Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster

Thanks a lot for the reply, I am sorry to post the code since I am not aware of the fact that it belongs to Windows

The line #include <windows.h> didn’t ring a bell ? :icon_wink:

, Could you please tell me as to what I should do in order to find code that has buttons etc and can work in Linux terminal?

My personal favorite is wxWidgets

Reply to this topic

Be a part of the DaniWeb community

We’re a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Дисковод не отображается в диспетчере устройств windows 10
  • Windows cmd размер каталога
  • Windows mobile logo png
  • System thread exception not handled windows 10 что это
  • Как показать все скрытые папки windows 10