- Setting up MinGW-w64
- Install MinGW-w64
- Test MinGW-w64
- Change name of the make executable
- Next steps
- Where to go from here?
- IT Novella
- настроить MinGW с Eclipse CDT
- Решение
- Другие решения
- Compiling a Win32 GUI app (without a console) using MinGW and Eclipse
- 2 Answers 2
- Not the answer you’re looking for? Browse other questions tagged c++ eclipse gcc mingw or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- How to add posix threads into eclipse on windows (MinGW)
Setting up MinGW-w64
Install MinGW-w64
MinGW-w64 comprises development tools for compiling and debugging. Download the Mingw-w64 Installer from here and follow the steps in the wizard. It is essential that the installation path does not contain any spaces. Therefore, you cannot install MinGW-w64 in Program Files. We recommend to create a folder mingw-w64 on your system drive (e.g., C:\mingw). Install a current version and specify win32 as thread when requested. Additionally, choose the architecture x86_64 .
After installing, you need to edit the PATH variable. You can access the System Control Center by pressing Windows Key + Pause . In the System window, click Advanced System Settings → Advanced (tab) → Environment Variables . For Windows 10, a quick access is to enter «Edit the system environment variables» in the Start Search of Windows and click the button «Environment Variables». Change the PATH variable (double-click on it or Select and Edit ), and add the path where your MinGW-w64 has been installed to e.g., C:\mingw\mingw64\bin . This folder should contain a number of .exe-files that you can see in your Explorer.
Test MinGW-w64
Open the command prompt of Windows either via the Program Menu or type cmd in the Start Search of Windows. Enter:
If you get an error such as «Command g++ not found», then something went wrong. In this case, verify that the PATH variable was successfully set and directs to the correct installation path. Additionally, open a new command prompt and try to execute the command again. If you try to reinstall, do not forget to restart the command prompt again (it does not update automatically). If this does not help, please ask for advice in the Forum.
Change name of the make executable
In your installation folder, inside the bin directory, you should find a file called mingw32-make.exe . Create a copy of the file in the same directory named make.exe . This is because this file is the one you will use to compile 4diac FORTE, and «make» is the command used for that throughout the documentation.
Next steps
Now that you successfully installed a compiler, you can continue with the next step of the installation tutorial. All information in the installation tutorial is based on a setup with MinGW-w64. For users with previous experience in building a 4diac FORTE, the details are listed:
- When generating files for compiling in CMake, the tool «Unix Makefiles» has to be selected.
- Also the architecture option needs to be set in CMake: The correct FORTE_ARCHITECTURE is Win32
- When compiling, open the Windows command line and go to the folder, where CMake built the binaries. Execute the command make to compile.
Where to go from here?
If you want to build a 4diac FORTE, here is a quick link back:
If you want to go back to the Start Here page, we leave you here a fast access
IT Novella
Eclipse — одна из наиболее популярных свободных кроссплатформенных сред разработки.
Для использования этой IDE для разработки на C++ необходимо установить компилятор и некоторые другие инструменты. Необходимые компоненты включает в себя коллекция бесплатных программ и библиотек MinGW.
Процесс установки и настройки связки MinGW и Eclipse состоит из следующих шагов:
1. Установка MinGW.
Установщик можно скачать с официального сайта mingw.org.
После установки запускаем MinGW Installation Manager (обычно он запускается автоматически), выбираем и устанавливаем пакеты mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++, mingw32-gcc-objc, msys-base в разделе Basic Setup.
2. Настройка системной переменной Path.
Для корректного вызова программ, входящих в состав MinGW, необходимо изменить значение системной переменной Path.
Для этого выбираем Пуск — Мой Компьютер — Свойства системы — Дополнительные параметры системы — Переменные среды. В списке системных переменных находим переменную Path и нажимаем изменить. В конце строки добавляем ;C:\MinGW\bin\; и нажимаем ok. После этого перезагружаем компьютер.
3. Установка Eclipse.
Дистрибутив можно скачать с сайта eclipse.org. Для программирования на C++ необходимо скачать сборку IDE for C/C++ developers.
Распаковываем скачанный архив в корень диска C. Открываем каталог C:\eclipse и запускаем eclipse.exe.
После запуска необходимо указать расположение каталога workspace. Лучше его также разместить в корне диска C.
Видео с демонстрацией установки:
настроить MinGW с Eclipse CDT
Я много об этом искал и прочитал большинство доступных ответов на подобную проблему, но все еще не мог ее решить. Поэтому любая помощь будет полезна.
Я использую Eclipse Mars (последняя версия после Luna) на Windows 7
MinGW устанавливается в «C: \ Program Files (x86) \ CodeBlocks \ MinGW \ bin».
Переменная среды «Путь» содержит «C: \ Program Files (x86) \ CodeBlocks \ MinGW \ bin; …»
Настройки -> C / C ++ -> Build -> Settings -> Discovery-> CDT GCC Параметры встроенного компилятора: команда для получения спецификаций компилятора
$
ручное выполнение gcc -E -P -v -dD в cmd из любого каталога дает
.
.
Цель: mingw32
,
.
Ошибки:
Программа g ++ / gcc не найдена в PATH
Я делаю проект на C ++, добавляю файл с программой hello world.
Я получаю ошибки «неразрешенное включение», и «printf» не может быть разрешен.
комментарий, если требуются какие-либо другие детали
Решение
Похоже, вы все делаете правильно.
Посмотрите эту ссылку и посмотрите, не пропустили ли вы что-нибудь в отношении установки MinGW / GCC:
В противном случае рассмотрите возможность удаления (или просто переименования) вашего текущего Eclipse и установки вместо него версии CDT (Eclipse для разработчиков C / C ++):
Во что бы то ни стало, вот несколько скриншотов из настроек моего свойства (я могу создать и успешно создать новый проект C):
Другие решения
Я думаю, что ваша проблема просто потому, что путь MinGW включает в себя пробелы. просто переустановка MinGW в корневой каталог «c: \ MinGW» решит вашу проблему.
Установите MinGW с базовыми установочными пакетами, выберите «mingw-developer-toolkit, mingw32-base, mingw32-gcc-g ++, msys-base». полная установка.
перезагрузите компьютер. затем проверьте настройки затмения.
Я надеюсь, что ваша проблема уже решена.
Я также сталкивался с такими проблемами, вам нужно установить переменную среды. В пути добавьте ваше местоположение MinGW, если вы еще не загрузили MinGW, перейдите сюда для загрузки MinGW:
http://sourceforge.net/projects/mingw/files/latest/download?source=files
Для получения более подробной информации, чтобы решить вашу проблему, это сработало для меня!
Compiling a Win32 GUI app (without a console) using MinGW and Eclipse
I’m using the eclipse IDE with MinGW as my compiler, to make a Win32 GUI app.
I want to get rid of the console, but compiling the program with -mwindows option has no effect and the console is still there.
Using the -Wl,—subsystem,windows flag also produces no effect. What am I doing wrong ?
2 Answers 2
For gcc on Windows, two things should be considered to build a non-console Windows app:
- Compiler option -mwindows
- Have WinMain()
It is possible, however, to manually specify -Wl,-subsystem,windows to the linker and include gdi32 and comdlg32 into the build. This is exactly what -mwindows automates.
try —machine-windows option. it helps me when I build asm code:
Not the answer you’re looking for? Browse other questions tagged c++ eclipse gcc mingw or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
How to add posix threads into eclipse on windows (MinGW)
Alright, so i’m running Eclipse Mars.1 (with MinGW compiler) on windows 8.1 OS and i’m trying to enable usage of POSIX threads. I’ve downloaded pthreads win32 from : https://www.sourceware.org/pthreads-win32 since windows doesn’t have pthread library included as linux does. After i downloaded the .zip file i’ve extracted the files like this:
- pthreadGC2.dll into C:\MinGW\bin
- pthread.h , sched.h, semaphore.h into C:\MinGW\include
- libpthreadGC2.a into C:\MinGW\lib
Back to the Eclipse, i’ve right clicked the project -> properties -> C/C++ build -> settings -> MinGW C linker , now here comes the problem, i have no idea what should i put into Libraries/Miscellaneous section. Eclipse is recognizing #include
(its not red color — underlining it) and pthread.h functions, but once i try to build it, it says this :
15:10:11 **** Incremental Build of configuration Debug for project ASD **** Info: Internal Builder is used for build gcc -o ASD.exe qweqwe.o -lpthread c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lpthread collect2.exe: error: ld returned 1 exit status
15:10:11 Build Finished (took 122ms)
I can’t figure out what am i doing wrong, i’ve tried changing library name (in the linker settings tab) to pthreadGC2, but if i do that Eclipse just underlines pthread_create and says that it is undefined reference to _imp_pthread_create.
If anyone tried and succeeded doing this, please share your wisdom. Thank you in advance!