Makefile win error

Странная ошибка makefile.win C++ Решение и ответ на вопрос 1972231

almarc

0 / 0 / 1

Регистрация: 12.10.2015

Сообщений: 54

1

01.05.2017, 19:29. Показов 19037. Ответов 10

Метки нет (Все метки)


Код:

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
 
int main(int argc, char** argv) 
{ 
cout << "Enter num1 +-/* num2" << endl;
int x, y;
char r;
cin >> x >> r >> y;
    if (r=='+')
    {
        cout << x + y << endl;
    }
    else if (r=='-')
    {
        cout << x - y << endl;
    }
    else if (r=='/')
    {
        cout << x / y << endl;
    }
    else if (r=='*')
    {
        cout << x * y << endl;
    }
    system ("pause");
}

При попытке скомпилировать, говорит:
cannot open output file Project 4.exe: Permission denied
[Error] ld returned 1 exit status
recipe for target ‘4.exe»‘ failed

После чего открывается файл «Makefile.win», с текстом:

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Project: Project 4
# Makefile created by Dev-C++ 5.11
 
CPP      = g++.exe
CC       = gcc.exe
WINDRES  = windres.exe
OBJ      = E:/main.o
LINKOBJ  = E:/main.o
LIBS     = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32
INCS     = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS  = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN      = "Project 4.exe"
CXXFLAGS = $(CXXINCS) -m32
CFLAGS   = $(INCS) -m32
RM       = rm.exe -f
 
.PHONY: all all-before all-after clean clean-custom
 
all: all-before $(BIN) all-after
 
clean: clean-custom
    ${RM} $(OBJ) $(BIN)
 
$(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
 
E:/main.o: E:/main.cpp
    $(CPP) -c E:/main.cpp -o E:/main.o $(CXXFLAGS)

При этом, строка:

$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)

Подсвечивается красным.

Редактор: Dev-C++. В чем может быть дело? Несколько раз программа запустилась нормально, потом это.

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

01.05.2017, 19:29

10

284 / 232 / 114

Регистрация: 07.09.2016

Сообщений: 584

01.05.2017, 19:50

2

у вас там от предыдущих запусков не осталось висячих процессов «Project 4.exe»? если остались — их надо прибить. может дело в том, что иде не может редактировать екзешник, потому что процесс запущен и винда залочила этот файл на изменения.



0



0 / 0 / 1

Регистрация: 12.10.2015

Сообщений: 54

01.05.2017, 20:03

 [ТС]

3

Нет, но через некоторое время файл удаляется и я снова могу его компилировать. При попытке новой компиляции снова эта ошибка на какое-то время.



0



284 / 232 / 114

Регистрация: 07.09.2016

Сообщений: 584

01.05.2017, 20:09

4

ну значит кто-то держит этот екзешник. почему и кто — хз. в момент появления ошибки бегите к файлу и попробуйте удалить. если не удаляется — значит точно кто-то держит. попробовать понять, кто его держит можно чем-нибудь типа процессмонитора https://technet.microsoft.com/… 96645.aspx. может это антивирус, может еще кто, а может процесс все-таки висит и ждет нажатия эникея судя по последней строке вашего кода.



0



0 / 0 / 1

Регистрация: 12.10.2015

Сообщений: 54

01.05.2017, 20:22

 [ТС]

5

Антивируса нет, держать ничего, кроме самого cpp, не может.
Кстати, заметил, что при закрытии консоли при первом нажатии консоль пишет время закрытия, и нужно нажать еще раз, чтобы программа закрылась. Раньше такого не было.



0



284 / 232 / 114

Регистрация: 07.09.2016

Сообщений: 584

01.05.2017, 20:26

6

ну раз «держать ничего, кроме самого cpp, не может» а файл что-то держит — остается одно: это происки дьявола. обратитесь в ближайшее отделение РПЦ за святой водой, попшикайте на клавиатуру. может поможет.



0



0 / 0 / 1

Регистрация: 12.10.2015

Сообщений: 54

01.05.2017, 20:46

 [ТС]

7

Экзорцист оказался бессилен. Боюсь, придется обратится к аккаунту с правами….. АДМИНИСТРАТОРА!
Мало ли, может у меня доступа нет, надо с админского аккаунта зайти.



0



Z1qqO

1 / 1 / 1

Регистрация: 20.07.2017

Сообщений: 32

12.01.2018, 01:31

8

Точно такая же ошибка возникает и у меня: в основном, она появляется тогда, когда, «серфируя» по интернету в поисках и изучении наличия хороших кодов и программ, я, отыскивая такой код, копирую его и вставляю в свой главного файла с функцией main. Обычно код, скопированный, в котором содержатся обычные управляющие операторы, арифметические операции и прочие начальные вещи — не конфликтует с компилятором. Но если же в коде, который я пытаюсь «скопипастить», присутствуют различного рода функции не совсем известного мне описания (код представлен ниже), то выдается такая же ошибка линковщика (компоновщика) — $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)

C++
1
2
3
4
5
6
7
8
9
10
11
POINT op;
    HWND hWnd=GetConsoleWindow();
    HDC hDC=GetDC(hWnd);
    SelectObject(hDC,GetStockObject(WHITE_PEN));   // СКОПИРОВАННЫЙ КОД
 
    MoveToEx(hDC,50,50,&op);
    LineTo(hDC,100,200);
 
    ReleaseDC(hWnd,hDC);
    std::cin.get();
    return 0;

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Project: Проект1
# Makefile created by Dev-C++ 5.11
 
CPP      = g++.exe
CC       = gcc.exe
WINDRES  = windres.exe
RES      = ../Project2/Project1_private.res
OBJ      = ../Project2/main.o ../Project2/GradeBook.o ../Project2/Account.o $(RES)
LINKOBJ  = ../Project2/main.o ../Project2/GradeBook.o ../Project2/Account.o $(RES)
LIBS     = -L"D:/Program Files/Dev-Cpp/MinGW64/lib32" -L"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32
INCS     = -I"D:/Program Files/Dev-Cpp/MinGW64/include" -I"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS  = -I"D:/Program Files/Dev-Cpp/MinGW64/include" -I"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN      = Project1.exe
CXXFLAGS = $(CXXINCS) -m32
CFLAGS   = $(INCS) -m32
RM       = rm.exe -f
 
.PHONY: all all-before all-after clean clean-custom
 
all: all-before $(BIN) all-after
 
clean: clean-custom
    ${RM} $(OBJ) $(BIN)            
 
$(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
 
../Project2/main.o: main.cpp
    $(CPP) -c main.cpp -o ../Project2/main.o $(CXXFLAGS)
 
../Project2/GradeBook.o: GradeBook.cpp
    $(CPP) -c GradeBook.cpp -o ../Project2/GradeBook.o $(CXXFLAGS)
 
../Project2/Account.o: Account.cpp
    $(CPP) -c Account.cpp -o ../Project2/Account.o $(CXXFLAGS)
 
../Project2/Project1_private.res: Project1_private.rc 
    $(WINDRES) -i Project1_private.rc -F pe-i386 --input-format=rc -o ../Project2/Project1_private.res -O coff

Миниатюры

Странная ошибка makefile.win
 



0



Z1qqO

1 / 1 / 1

Регистрация: 20.07.2017

Сообщений: 32

12.01.2018, 01:32

9

Точно такая же ошибка возникает и у меня: в основном, она появляется тогда, когда, «серфируя» по интернету в поисках и изучении наличия хороших кодов и программ, я, отыскивая такой код, копирую его и вставляю в свой главного файла с функцией main. Обычно код, скопированный, в котором содержатся обычные управляющие операторы, арифметические операции и прочие начальные вещи — не конфликтует с компилятором. Но если же в коде, который я пытаюсь «скопипастить», присутствуют различного рода функции не совсем известного мне описания (код представлен ниже), то выдается такая же ошибка линковщика (компоновщика) — $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)

C++
1
2
3
4
5
6
7
8
9
10
11
POINT op;
    HWND hWnd=GetConsoleWindow();
    HDC hDC=GetDC(hWnd);
    SelectObject(hDC,GetStockObject(WHITE_PEN));   // СКОПИРОВАННЫЙ КОД
 
    MoveToEx(hDC,50,50,&op);
    LineTo(hDC,100,200);
 
    ReleaseDC(hWnd,hDC);
    std::cin.get();
    return 0;

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Project: Проект1
# Makefile created by Dev-C++ 5.11
 
CPP      = g++.exe
CC       = gcc.exe
WINDRES  = windres.exe
RES      = ../Project2/Project1_private.res
OBJ      = ../Project2/main.o ../Project2/GradeBook.o ../Project2/Account.o $(RES)
LINKOBJ  = ../Project2/main.o ../Project2/GradeBook.o ../Project2/Account.o $(RES)
LIBS     = -L"D:/Program Files/Dev-Cpp/MinGW64/lib32" -L"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32
INCS     = -I"D:/Program Files/Dev-Cpp/MinGW64/include" -I"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS  = -I"D:/Program Files/Dev-Cpp/MinGW64/include" -I"D:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"D:/Program Files/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN      = Project1.exe
CXXFLAGS = $(CXXINCS) -m32
CFLAGS   = $(INCS) -m32
RM       = rm.exe -f
 
.PHONY: all all-before all-after clean clean-custom
 
all: all-before $(BIN) all-after
 
clean: clean-custom
    ${RM} $(OBJ) $(BIN)                                                                       // КОД ЛИНКОВЩИКА ПОСЛЕ КОМПИЛЯЦИИ
 
$(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
 
../Project2/main.o: main.cpp
    $(CPP) -c main.cpp -o ../Project2/main.o $(CXXFLAGS)
 
../Project2/GradeBook.o: GradeBook.cpp
    $(CPP) -c GradeBook.cpp -o ../Project2/GradeBook.o $(CXXFLAGS)
 
../Project2/Account.o: Account.cpp
    $(CPP) -c Account.cpp -o ../Project2/Account.o $(CXXFLAGS)
 
../Project2/Project1_private.res: Project1_private.rc 
    $(WINDRES) -i Project1_private.rc -F pe-i386 --input-format=rc -o ../Project2/Project1_private.res -O coff



0



6 / 3 / 0

Регистрация: 19.03.2019

Сообщений: 145

14.06.2019, 19:06

10

Цитата
Сообщение от almarc
Посмотреть сообщение

Кстати, заметил, что при закрытии консоли при первом нажатии консоль пишет время закрытия, и нужно нажать еще раз, чтобы программа закрылась. Раньше такого не было.

В Dev-C++ откомпилированный код открывается не просто так, а через ConsolePauser.exe. Он сначала выполняет программу, а после её завершения выводит время выполнения и возвращённое значение и ждёт нажатия любой клавиши.
В общем, скорее всего в настройках что-то поменяли.

Миниатюры

Странная ошибка makefile.win
 

Странная ошибка makefile.win
 



0



6 / 3 / 0

Регистрация: 19.03.2019

Сообщений: 145

15.06.2019, 13:18

11

Чтобы отключить эту функцию, перейди на Сервис -> Параметры среды и убери галочку с Pause console programs after return

Миниатюры

Странная ошибка makefile.win
 

Изображения

 



0



  • Summary

  • Files

  • Reviews

  • Support

  • Wiki

  • Mailing Lists

  • Code

  • Tickets ▾

    • Feature Requests
    • Bugs
    • Patches
  • News

  • Discussion

Menu

makefile.win cannot compile


Created:

2007-05-31

Updated:

2012-09-26

  • Anubis208

    I am currently making a window with menus. The project has a main.cpp file, a resource.h file, and a menu.rc file. When I try to compile the project, I get the following message

    Could not create makefile: «C:Documents and SettingsCarl KolboMy
    DocumentsDev-CppmenuMakefile.win»
    I/O error 32


    Is there any way to fix this?

    • Anubis208

      I made a folder under C with my fathers permission but the same thing happens. compile log: Compiler: Default compiler
      Building Makefile: «C:mycppstuffmenu3Makefile.win»
      Executing make…
      make.exe -f «C:mycppstuffmenu3Makefile.win» all
      make.exe: *** No rule to make target `all’. Stop.

      Execution terminated

      I get the pop up: Could not create Makefile:»C:/mycppstuffmenu3Makefile.win I/O error 32

      • Wayne Keen

        Did you copy and paste your project in the new location, or did you create a new project from scratch?

        Wayne

    • Anubis208

      I meant the popup error message, not the compile log. When I open the Makefile in Notepad but it is blank. We have removed ther faulty drive so it’s not the cause. I will look through taht and try to compile it command line.

    • Anonymous

      The command line build will not work is the makefile is empty, it looks like Dev-C++ is encountering problems generating the makefile. This is likely to be a system issue rather than a Dev-C++ issue.

      Try these.

      1) Delete the makefile.win file, and Rebuild All
      2) Run chkdsk /f from the command line, when prompted answer yes to check on next reboot, and reboot.
      3) Run your virus scanner to do a full scan.
      4) Temporarily disable your anti-virus tool and try again. (do this while disconnected from the Internet)

      Clifford

    • Anubis208

      The first suggestion worked. Thanks a lot for the Help!

      • Anonymous

        … but do the second as well — there was obviously something wrong with this drive, chkdsk may fix it and prevent subsequent problems.

    • Wayne Keen

      A couple of notes/questions/requests

      (1) Please post your full Basic 3, rather than just excerpting an error message. (The Basic 3 are covered the first thing in the thread titled «Please Read Before Posting a Question»)

      (2) It is a really bad idea to put a project in a path with spaces in it, like

      C:Documents and SettingsCarl KolboMy DocumentsDev-Cpp

      (That is mentioned prominently in the «Please Read» thread — I am getting the impression that you didn’t read it before posting a question?) ;-)

      Wayne

    • Anubis208

      I did read it , but that was a few weeks ago. I don’t have a choice about filename spaces, because windows XP handles it that way if you have multiple users on the same computer.
      I’m using version 4.9.9.2,
      compile log:Compiler: Default compiler
      Building Makefile: «C:Documents and SettingsCarl KolboMy DocumentsDev-CppmenuMakefile.win»
      Executing make…
      make.exe -f «C:Documents and SettingsCarl KolboMy DocumentsDev-CppmenuMakefile.win» all
      make.exe: *** No rule to make target `all’. Stop.

      Execution terminated
      Every project I’ve tried so far with the three above-mentioned files has done this.
      That should cover the three things.

      • Wayne Keen

        I use XP on a variety of machines, and I don’t have an issue with creating a directory like
        c:mycstuff — what type of user are you on the machine in question?

        Wayne

    • Anubis208

      I’m an administrator, but my father, who owns the machine, won’t let me do anything like that. I have asked him about it.

      • Wayne Keen

        Well, you are going to have problems working that way. Intermittent, but serious.
        You probably will not be able to use Dev-C++ that way.

        I see several options:

        (1) Tell your father that the restriction to keeping all files in «my documents»
        is keeping Dev from being reliably useful — perhaps he will change his mind, if
        not

        (2) You should probably uninstall Dev-C++, and install another IDE in its place.
        wxDev-C++ seems to do OK with spaces, and is probably the next generation of
        Dev. CodeBlocks is another good MinGW based IDE.

        Wayne

    • Anubis208

    • Anonymous

      In that case you may be prevented from using Dev-C++ effectively, if you cannot get a concession on that one, use an alternative development tool. MS VC++ 2005 Express Edition for example.

      Alternatively:

      1) Open Notepad and enter the following text:

      subst x: «C:Documents and SettingsCarl KolboMy Documents»

      2) Save the file as «mapx.bat» in your My Documents folder.

      3) Drag this file onto the Start->Programs->Startup menu, it will create a short-cut to the batch file there.

      Now every time you log in, the batch file will run and create a virtual drive X:, you your project now appears in X:Dev-Cppmenu (no spaces — tada!). (Note it also appears in My Documents — these are the same file not copies).

      Note that the makefile may require regeneration to remove references to the old paths (do a Rebuild All).

      Replace X for whatever drive letter you wish. The Startup stuff applies only to your login and poses no particular security risk, everyone should be happy.

      A third alternative is to get an external drive or USB memory stick and keep your files on that. Teh compilation process may thrash it and shorten its life however!

      Clifford

    • Anonymous

      Several other solutions were suggested, did you try them? I would suggest that you might try them in this order:

      1) The subst solution
      2) wxDev-C++ as this is effectively Dev-C++ with additional tools, libraries and most importantly bug and annoyance fixes.
      3) Use some other IDE that can also uses MinGW as its compiler since your source code will not require any changes( for example Code::Blocks or Eclipse)
      4) Use Microsoft’s free tools. This approach has merit even if only for the class leading debugger.

      Clifford

      • Wayne Keen

        Does this path look unusual to you Clifford?

        Could not create Makefile:»C:/mycppstuffmenu3Makefile.win I/O error 32

        Wayne

    • Anubis208

      I started a new one from scratch.
      I can’t use any other programs right now, one of our hard drives had some problems and we need to get a new one.

      • Wayne Keen

        What does the result of a «Rebuild All» look like?

        Wayne

    • Anubis208

      Compiler: Default compiler
      Building Makefile: «C:mycppstuffmenu3Makefile.win»
      Executing make clean
      make.exe: *** No rule to make target `clean’. Stop.

      Execution terminated

      The error message is the same.

    • Anonymous

      >> I can’t use any other programs right now,
      subst is not another program, it is a command built into cmd.exe. However, I am guessing that the problem will occur regardless of path or location, but it will avoid any problems that might be associated with file permissions or parental anxieties about untidy hard drives.

      >> The error message is the same.

      No, it is different! This time it is failing to find the ‘clean’ target rather than the ‘all’ target. If your hard drive has a problem perhaps this is related!?

      Can you open the make file (makefile.win) in a text editor (like Dev-C++ itself or Notepad)?

      Did Dev-C++ even get as far as generating the makefile?

      What does the make file contain? Is it complete?

      What happens if you attempt the build from the command line (enter the following commands):

      > cd C:mycppstuffmenu3
      > path=c:dev-cppbin;%path%
      > make -fmakefile.win all

      Then use the console edit menu to copy and paste the text here. (instruction here http://sourceforge.net/forum/message.php?msg_id=4138326 if you have never done this).

      Clifford


Log in to post a comment.

>
Dev-C++ — не хочет компилять

  • Подписаться на тему
  • Сообщить другу
  • Скачать/распечатать тему



Сообщ.
#1

,
08.06.03, 16:06

    Full Member

    ***

    Рейтинг (т): 2

    Dev-C++ Совершенно не хочет компилить никакие проекты.
    При попытке откомпилить проект(msdos app) оно грит:
    Compiler: Default compiler
    Building Makefile: «F:Program FilesDev-CppProjectsDOSMakefile.win»
    Executing  make…
    make.exe -f «F:Program FilesDev-CppProjectsDOSMakefile.win» all
    g++.exe -c main.cpp -o main.o -I»F:/Program Files/Dev-Cpp/include/c++»  -I»F:/Program Files/Dev-Cpp/include/c++/mingw32″  -I»F:/Program Files/Dev-Cpp/include/c++/backward»  -I»F:/Program Files/Dev-Cpp/include»  

    «F:DOCUME~1Smoke» ­¥ ï¥âáï ¢­ãâ७­¥© ¨«¨ ¢­¥è­¥©
    ª®¬ ­¤®©, ¨á¯®«­ï¥¬®© ¯à®£à ¬¬®© ¨«¨ ¯ ª¥â­ë¬ ä ©«®¬.

    make.exe: *** [main.o] Error 1

    Execution terminated

    и так всегда   :(

    Вроде бы все настроил, все фолдеры указал, а он все равно упирается. Мож где че позабыл?


    nnn



    Сообщ.
    #2

    ,
    09.06.03, 04:25

      Ты бы код проекта полностью привел…
      И Dev-Cpp какой версии?


      Zmoukie



      Сообщ.
      #3

      ,
      09.06.03, 10:38

        Full Member

        ***

        Рейтинг (т): 2

        версия — Dev-C++ 4.9.8.0.
        проект создавал через file->new->project->winapp

        ExpandedWrap disabled

          <br>#include <windows.h><br><br>/*  Declare Windows procedure  */<br>LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);<br><br>/*  Make the class name into a global variable  */<br>char szClassName[ ] = «WindowsApp»;<br><br>int WINAPI WinMain (HINSTANCE hThisInstance,<br>                    HINSTANCE hPrevInstance,<br>                    LPSTR lpszArgument,<br>                    int nFunsterStil)<br><br>{<br>    HWND hwnd;               /* This is the handle for our window */<br>    MSG messages;            /* Here messages to the application are saved */<br>    WNDCLASSEX wincl;        /* Data structure for the windowclass */<br><br>    /* The Window structure */<br>    wincl.hInstance = hThisInstance;<br>    wincl.lpszClassName = szClassName;<br>    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */<br>    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */<br>    wincl.cbSize = sizeof (WNDCLASSEX);<br><br>    /* Use default icon and mouse-pointer */<br>    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);<br>    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);<br>    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);<br>    wincl.lpszMenuName = NULL;                 /* No menu */<br>    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */<br>    wincl.cbWndExtra = 0;                      /* structure or the window instance */<br>    /* Use Windows’s default color as the background of the window */<br>    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;<br><br>    /* Register the window class, and if it fails quit the program */<br>    if (!RegisterClassEx (&wincl))<br>        return 0;<br><br>    /* The class is registered, let’s create the program*/<br>    hwnd = CreateWindowEx (<br>           0,                   /* Extended possibilites for variation */<br>           szClassName,         /* Classname */<br>           «Windows App»,       /* Title Text */<br>           WS_OVERLAPPEDWINDOW, /* default window */<br>           CW_USEDEFAULT,       /* Windows decides the position */<br>           CW_USEDEFAULT,       /* where the window ends up on the screen */<br>           544,                 /* The programs width */<br>           375,                 /* and height in pixels */<br>           HWND_DESKTOP,        /* The window is a child-window to desktop */<br>           NULL,                /* No menu */<br>           hThisInstance,       /* Program Instance handler */<br>           NULL                 /* No Window Creation data */<br>           );<br><br>    /* Make the window visible on the screen */<br>    ShowWindow (hwnd, nFunsterStil);<br><br>    /* Run the message loop. It will run until GetMessage() returns 0 */<br>    while (GetMessage (&messages, NULL, 0, 0))<br>    {<br>        /* Translate virtual-key messages into character messages */<br>        TranslateMessage(&messages);<br>        /* Send message to WindowProcedure */<br>        DispatchMessage(&messages);<br>    }<br><br>    /* The program return-value is 0 — The value that PostQuitMessage() gave */<br>    return messages.wParam;<br>}<br><br><br>/*  This function is called by the Windows function DispatchMessage()  */<br><br>LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)<br>{<br>    switch (message)                  /* handle the messages */<br>    {<br>        case WM_DESTROY:<br>            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */<br>            break;<br>        default:                      /* for messages that we don’t deal with */<br>            return DefWindowProc (hwnd, message, wParam, lParam);<br>    }<br><br>    return 0;<br>}<br>

        в закладке compiler пишет «f:dev-cppprojectsproject1makefile.win [buils error] [main.o] Error1»

        меня тревожит этот «main.o» — что это за файл и че там должно быть?
        компилер его сам не создает(хотя, по-моему должен), а если попробовать создать самому, то тада выдает другую ошибку: » F:Dev-CppProjectsProject1Makefile.win
        [Build Error]  [Project1.exe] Error 1″


        nnn



        Сообщ.
        #4

        ,
        09.06.03, 10:55

          main.o — объектный файл, генерируемый компилятором, потом он линкуется в твоем случае в экзешник…
          А у тебя в project->options->files включен файл main.cpp — ведь его текст ты и привел в топике… ???


          Zmoukie



          Сообщ.
          #5

          ,
          09.06.03, 11:25

            Full Member

            ***

            Рейтинг (т): 2

            все включено (include in compilation, include in linking).
            не представляю, в чем проблема все настройки уже раз сто облазил   :(
            а у тя с первого раза все завелось?


            Zmoukie



            Сообщ.
            #6

            ,
            09.06.03, 17:50

              Full Member

              ***

              Рейтинг (т): 2

              что самое удивительное — 4ый devcpp работает без проблем!


              nnn



              Сообщ.
              #7

              ,
              10.06.03, 04:27

                Да. без проблем…
                У тебя пути к c:dev-Cppinclude и ..lib прописаны в проекте?


                nnn



                Сообщ.
                #8

                ,
                10.06.03, 05:03

                  Могу тебе заслать готовый проект под Dev-Cpp


                  Zmoukie



                  Сообщ.
                  #9

                  ,
                  10.06.03, 10:26

                    Full Member

                    ***

                    Рейтинг (т): 2

                    Все прописал, та же фигня. четвертый работает на ура, а пятый не хочет.
                    кинь тада проект на sm0k3@mail.ru

                    Сообщение отредактировано: Smoke — 10.06.03, 10:27


                    Zmoukie



                    Сообщ.
                    #10

                    ,
                    10.06.03, 10:43

                      Full Member

                      ***

                      Рейтинг (т): 2

                      Ха! если создавать не проект, а просто отдельный цпп-файл, то все компилится! Бредятина какая-то  ??? >:(

                      Guru

                      ElcnU



                      Сообщ.
                      #11

                      ,
                      21.07.16, 15:23

                        Moderator

                        *******

                        Рейтинг (т): 823

                        !

                        уже не актуально.
                        Хватит флудить

                        0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)

                        0 пользователей:

                        • Предыдущая тема
                        • Visual C++ / MFC / WTL
                        • Следующая тема

                        [ Script execution time: 0,0323 ]   [ 16 queries used ]   [ Generated: 9.02.23, 21:21 GMT ]  

                        • Forum
                        • Beginners
                        • Dev C++ Hello World Program outputs make

                        Dev C++ Hello World Program outputs make Error -largenumber

                        The Machine is running the latest version of Windows 10.
                        Dev C++ 4.9.9.2 (mingw) was installed on the C: Drive (C:/Dev-Cpp) via the official bloodshed website.
                        The Souce Code(s) is saved in the Documents/DevC++ Folder.

                        This is the source code:

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        #include <iostream>
                        
                        int main()
                        {
                            std::cout << "Running" << std::endl;
                            system("PAUSE");
                            return 0;
                        }
                        

                        1. — Output of Compile & Run (F9):
                        ———————————
                        C:UsersmyusernameDocumentsDevC++Makefile.win [Build Error] [main.o] Error -1073741674
                        ———————————

                        2. — Output of Compiler Log:
                        ———————————
                        Compiler: Default compiler
                        Building Makefile: «C:myusernamemyusernameDocumentsDevC++Makefile.win»
                        Executing make…
                        make.exe -f «C:UsersmyusernameDocumentsDevC++Makefile.win» all
                        g++.exe -c main.cpp -o main.o -I»C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include» -I»C:/Dev-Cpp/include/c++/3.4.2/backward» -I»C:/Dev-Cpp/include/c++/3.4.2/mingw32″ -I»C:/Dev-Cpp/include/c++/3.4.2″ -I»C:/Dev-Cpp/include»
                        make.exe: *** [main.o] Error -1073741674
                        Execution terminated

                        ———————————

                        When running g++ (—version) in a regular cmd, bash or powershell, there’s no output, nor any error whereas gcc gives an «Internal error: Aborted (programm collect2)» error.

                        Appended C:Dev-Cppbin System-Path Variable.

                        Last edited on

                        Well, your very first issue is that you’re using Dev C++. I would recommend a better IDE like Code::Blocks or a more professional one like Visual Studio(I recommend VS), both of which you can get for free. They also give you better error messages and tell you what is wrong.

                        I ran the code in Visual Studio 2019 and on a few online compilers and it runs fine for me. I’m unsure what the error is.

                        Also, dont use system anything. use std::cin.get() to wait instead.

                        Something like this:

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        10
                        11
                        12
                        13
                        14
                        #include <iostream>
                        
                        using std::cout;
                        using std::cin;
                        using std::endl;
                        
                        int main()
                        {
                            cout << "Running" << endl;
                            
                            cin.get();
                        
                            return 0;
                        }

                        Last edited on

                        It’s either not installed properly or it’s something weird like a bad reaction with your real-time antivirus protection (which you would need to disable if that’s the case).

                        However, I agree that codeblocks is better than dev-c++. You might want to totally uninstall dev-c++ and get codeblocks instead.

                        Or the free MS VS 2019 Community edition.

                        Hello My Echo My Shadow And Me,

                        If you must use Dev C++ there is a newer version 5.11 that would be better. Otherwise Code::Blocks or a version of MSVS, 2017 or 2019, would be a better choice. I use MSVS 2017 and 2019, but do not take that as an endorsement because I also use Code::Blocks and others at times.

                        Your code should not make any difference, but Dev C++ is set up to use a standard that is pre2011 so you may have some problems. Or as dutch said it may have been a bad install.

                        If it is properly installed consider following this:

                        
                        The DEV C++ that I have is version 5.11 with a build year of 2015.
                        
                        To adjust the settings:
                         • Under the Tools menu choose "Compiler Options".
                         • In the window that comes up you will see tabs for "General", "Settings", "Directories" and "Programs".
                         • Choose the settings tab.
                         • In the next set of tabs that come up choose "Code Generation".
                         • The last line should say “Language Standard (-std).
                         • On the right side of that line click on the down arrow.
                         • In the list box that comes up choose "ISO C++ 11".  // I believe this is the best choice.
                         • Press "OK".
                        This will let the IDE and compiler use the C++11 standards.
                        
                        You should also look under the “Help” menu choice and click on "About" for more information.
                        
                        

                        Just so you know I ran this in my installed version of Dev C++ wit no problem.

                        You posted the contents of the log file, but the «Makefile.win» file would be of more use.

                        Andy

                        Installing a newer (5.11) seems to have fixed the issue magically.
                        It is worth noting that the newer version were (auto)installed into the Program Files(x86) folder instead of directly on the C: drive. Furthermore TDM was chosen.

                        Thanks everyone.

                        Last edited on

                        Topic archived. No new replies allowed.

                        Member Avatar

                        17 Years Ago

                        Hi again everyone, Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im not getting anywhere with it…I am interested in working with Windows Programming in C/C++ at the moment and every project I try to compile gives the same error…

                        C:Dev-CppCurrent_ProjectMakefile.win [Build Error]  [main.o] Error 1

                        and this is my compile log

                        Compiler: Default compiler
                        Building Makefile: "C:Dev-CppCurrent_ProjectMakefile.win"
                        Executing  make...
                        make.exe -f "C:Dev-CppCurrent_ProjectMakefile.win" all
                        g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -pg -g3
                        
                        The system cannot find the path specified.
                        
                        make.exe: *** [main.o] Error 1
                        
                        Execution terminated

                        I have tried many times re-installing the program aswell as re-configuring it and installing with fresh configurations etc…nothing seems to work, I get the same error over and over again…anyone know why or how to overcome it ?


                        Recommended Answers

                        What is the code in main.cpp, and where is main.cpp located?

                        Jump to Post

                        Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…

                        Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4'
                        Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'

                        Im sure …

                        Jump to Post

                        Hey i was also suffering that problem when i came upon your thread, and i found however , when out of nowhere my brain said why did this work yesterday and not today, the answer is i had started a windows project today instead of a console application and that …

                        Jump to Post

                        The only thing im concerned about there, is why are you using dos to complie when dev cpp has a very useful compilers which uses makefiles (which are a godsend in bigger projects)

                        ive never used g++ in cmd so im not sure what the correct syntax for it …

                        Jump to Post

                        ./Borland/libxml library/lib/libxml2-bcc.lib: file not recognized: File format not recognized

                        that error is referring to libxml2-bcc.lib. gcc and g++ do not recognize libraries wth *.lib file extension, only *.a file extension. That library was built for a different compiler.

                        Jump to Post

                        All 45 Replies

                        Member Avatar


                        Ancient Dragon

                        5,243



                        Achieved Level 70



                        Team Colleague



                        Featured Poster


                        17 Years Ago

                        might be a dumb question — but did you check your computer to see if those -I<path> paths actually exist?

                        Member Avatar

                        17 Years Ago

                        Is C:Dev-Cppbin in your path?

                        C:TestGnuC>path
                        PATH=C:WINNTsystem32;C:WINNT;C:WINNTSystem32Wbem;C;iccbin;C:Dev-Cppbin;C:BC5BIN;C:watcomBINNT;C:watcomBINW;c:Perlbin;C:Program FilesActiveState Komodo 3.1;C:Program FilesCommon FilesGTK2.0bin;C:Program FilesCommon FilesAutodesk Shared;C:Program FilesAutodeskDWG TrueView;..tool;C:Program Filesdoxygenbin;C:Program FilesSubversionbin;C:Program FilesMicrosoft Visual StudioCommonToolsWinNT;C:Program FilesMicrosoft Visual StudioCommonMSDev98Bin;C:Program FilesMicrosoft Visual StudioCommonTools;C:Program FilesMicrosoft Visual StudioVC98bin;C:Program FilesMicrosoft Visual StudioCommonIDEIDE98;C:Program Filesvslickwin;C:NECTOOLSBIN;..tool;C:COSMICEVAL08;c:nectools32bin;

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Yes I have checked all of the paths and they all exist…this even happens when I compile a project from scratch..ie…

                        C:Dev-CppNew_ProjectMakefile.win [Build Error]  [main.o] Error 1 
                        
                        Compiler: Default compiler
                        Building Makefile: "C:Dev-CppNew_ProjectMakefile.win"
                        Executing  make...
                        make.exe -f "C:Dev-CppNew_ProjectMakefile.win" all
                        gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"   
                        
                        The system cannot find the path specified.
                        
                        make.exe: *** [main.o] Error 1
                        
                        Execution terminated
                        

                        Dave what do you mean by is C:Dev-Cppbin in my path ? and what is all of that within the code box? I thought it may have come from command prompt or something like that so i tried typing…

                        C:>path
                        PATH=C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem
                        C:>
                        

                        I dont have a clue what any of that is for, could you explain it? thanks.

                        Edited

                        10 Years Ago
                        by diafol because:

                        fixed formatting

                        Member Avatar

                        17 Years Ago

                        I’m asking you what I think your make utility is asking you. Does it know where to look for g++?

                        The stuff in the box is a copy of my result when I execute the path command in a command shell. It is telling me that the path to g++ is indeed available to my system. Yours tells you this is not so.

                        When you install Dev-Cpp, do you need to reboot to update the path? (It’s been so long since I’ve done this that I forget.)

                        Member Avatar


                        Ancient Dragon

                        5,243



                        Achieved Level 70



                        Team Colleague



                        Featured Poster


                        17 Years Ago

                        >>When you install Dev-Cpp, do you need to reboot to update the path?

                        I think it depends on which version of Windows is running. W2K/XP, definitely not. Win95/98/ME, I’m not sure either (I never used ME)

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Oh right…Im running windows xp professional with sp1, im never prompted to reboot or anything like that, it has always worked perfect until now, im continuously getting these errors…yes g++.exe is in the c:Dev-Cppbin directory…do you have any suggestions on what i should do?

                        Member Avatar

                        17 Years Ago

                        Add c:Dev-Cppbin to your path. Reboot.

                        (But it does appear to find the make utility, which I would assume is in the same directory, so I’m reaching for straws.)

                        Member Avatar


                        Ancient Dragon

                        5,243



                        Achieved Level 70



                        Team Colleague



                        Featured Poster


                        17 Years Ago

                        Add c:Dev-Cppbin to your path. Reboot.

                        (But it does appear to find the make utility, which I would assume is in the same directory, so I’m reaching for straws.)

                        I use XP Pro too.

                        you might also check the length of the PATH environment variable. On my computer it’s so long that there isn’t any room left to add more. So I have a batch file to truncate the PATH to bare necessity so that I can run other command-line programs from command prompt.

                        Look at the end of the PATH as shown in command prompt — if the last path isn’t all there, then you probably have to same problem that I do.

                        Member Avatar


                        dwks

                        149



                        Posting Whiz in Training


                        17 Years Ago

                        you might also check the length of the PATH environment variable. On my computer it’s so long that there isn’t any room left to add more. So I have a batch file to truncate the PATH to bare necessity so that I can run other command-line programs from command prompt.

                        You can change this. I’ve forgotten how I did it, but I ran into the same problem. Increasing the enviroment size fixed it.

                        I think it’s a parameter to command.com in config.sys.

                        Member Avatar


                        Ancient Dragon

                        5,243



                        Achieved Level 70



                        Team Colleague



                        Featured Poster


                        17 Years Ago

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Ah ok I will try to do that in a few moments once I find out how lol…but why isnt there lots of other .exe files (or directories) listed in path, I have many other applications installed…

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        That didnt work, but I dont think I did it correctly…how would i add that to path ?

                        Member Avatar

                        17 Years Ago

                        I generally right-click My Computer, and select Properties to bring up the System Properties dialog. In the Advanced tab, click the Environment Variables… button. Then find the path variable and edit it. Alternatively, I think you can add it to the autoexec.bat which should be in the root directory.

                        You’ll know you’ve done it correctly when you go to a command shell and type path, like you did earlier, and it now shows the d:dev-cppbin as being part of the path.

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Thanks, I have did that, It has been added to path successfully but Dev-C++ still doesnt work. I have rebooted as soon as i added C:Dev-Cppbin; to path but the error is still the same…any mroe suggestions ?

                        Member Avatar

                        17 Years Ago

                        What is the code in main.cpp, and where is main.cpp located?

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        This happens every single time i try to compile any project whether it would be a template given by Dev-C++ when creating a windows application or something I have been working on…I save all the files like the source, resource, header and all the files created by the compiler in the same directory, «C:Dev-Cpp» from which I create a another directory depending on what Im creating for example «C:Dev-CppNew_Project» is where I have saved all the files of a brand new project…and here is what main.cpp contains…

                        #include <windows.h>
                        
                        /*  Declare Windows procedure  */
                        LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
                        
                        /*  Make the class name into a global variable  */
                        char szClassName[ ] = "WindowsApp";
                        
                        int WINAPI WinMain (HINSTANCE hThisInstance,
                                            HINSTANCE hPrevInstance,
                                            LPSTR lpszArgument,
                                            int nFunsterStil)
                        
                        {
                            HWND hwnd;               /* This is the handle for our window */
                            MSG messages;            /* Here messages to the application are saved */
                            WNDCLASSEX wincl;        /* Data structure for the windowclass */
                        
                            /* The Window structure */
                            wincl.hInstance = hThisInstance;
                            wincl.lpszClassName = szClassName;
                            wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
                            wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
                            wincl.cbSize = sizeof (WNDCLASSEX);
                        
                            /* Use default icon and mouse-pointer */
                            wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
                            wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
                            wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
                            wincl.lpszMenuName = NULL;                 /* No menu */
                            wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
                            wincl.cbWndExtra = 0;                      /* structure or the window instance */
                            /* Use Windows's default color as the background of the window */
                            wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
                        
                            /* Register the window class, and if it fails quit the program */
                            if (!RegisterClassEx (&wincl))
                                return 0;
                        
                            /* The class is registered, let's create the program*/
                            hwnd = CreateWindowEx (
                                   0,                   /* Extended possibilites for variation */
                                   szClassName,         /* Classname */
                                   "Windows App",       /* Title Text */
                                   WS_OVERLAPPEDWINDOW, /* default window */
                                   CW_USEDEFAULT,       /* Windows decides the position */
                                   CW_USEDEFAULT,       /* where the window ends up on the screen */
                                   544,                 /* The programs width */
                                   375,                 /* and height in pixels */
                                   HWND_DESKTOP,        /* The window is a child-window to desktop */
                                   NULL,                /* No menu */
                                   hThisInstance,       /* Program Instance handler */
                                   NULL                 /* No Window Creation data */
                                   );
                        
                            /* Make the window visible on the screen */
                            ShowWindow (hwnd, nFunsterStil);
                        
                            /* Run the message loop. It will run until GetMessage() returns 0 */
                            while (GetMessage (&messages, NULL, 0, 0))
                            {
                                /* Translate virtual-key messages into character messages */
                                TranslateMessage(&messages);
                                /* Send message to WindowProcedure */
                                DispatchMessage(&messages);
                            }
                        
                            /* The program return-value is 0 - The value that PostQuitMessage() gave */
                            return messages.wParam;
                        }
                        
                        
                        /*  This function is called by the Windows function DispatchMessage()  */
                        
                        LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                        {
                            switch (message)                  /* handle the messages */
                            {
                                case WM_DESTROY:
                                    PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
                                    break;
                                default:                      /* for messages that we don't deal with */
                                    return DefWindowProc (hwnd, message, wParam, lParam);
                            }
                        
                            return 0;
                        }

                        Member Avatar

                        17 Years Ago

                        Have you tried compiling using the command-line?

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        yes I have tried that, it doesnt work.

                        Member Avatar

                        17 Years Ago

                        I save all the files like the source, resource, header and all the files created by the compiler in the same directory, «C:Dev-Cpp» from which I create a another directory depending on what Im creating for example «C:Dev-CppNew_Project» is where I have saved all the files of a brand new project…and here is what main.cpp contains…

                        So you’re saying that you are saving main.cpp in the compiler’s home directory «C:Dev-Cpp»? First, that a practice I generally avoid. Though I doubt it’s the problem here.

                        It looks to me that the make utility is not finding the source file. Could you post your makefile and .dev file? And state which directory these are in? And am I correct in understanding that you have main.cpp saved in «C:Dev-Cpp»?

                        Member Avatar


                        kon_t

                        0



                        Newbie Poster


                        17 Years Ago

                        Thanks, I have did that, It has been added to path successfully but Dev-C++ still doesnt work. I have rebooted as soon as i added C:Dev-Cppbin; to path but the error is still the same…any mroe suggestions ?

                        you definitely have a config problem. Your path is wrong &/or dev c++ isnt installed correctly.

                        some of the following has already been suggested, but ill put it here for completeness anyway.

                        1st start up a cmd prompt box (click on start, then run & then type ‘cmd’ in the text box).

                        from the cmd prompt box:

                        You can test the path setting by just typing ‘g++’. If the path is correct you will see something like:

                        g++: no input files

                        you can also try typing ‘make’, which should produce:

                        make: *** No targets specified and no makefile found. Stop.

                        If neither work, your path setting is definitely wrong.
                        If one works & not the other, you have a mixed up configuration.

                        You can try searching for «g++» and make sure that the folder that it is actually in is alos the folder in the path setting.

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        I have carried out both of those commands in command prompt, and they both produced what expected…

                        To keep things simple I will attempt to make another windows project and compile it on the root («C:»), I will post the makefile(*.win) and project file(*.dev) here…..

                        Project file…

                        [Project]
                        FileName=Project1.dev
                        Name=Project1
                        UnitCount=1
                        Type=0
                        Ver=1
                        ObjFiles=
                        Includes=
                        Libs=
                        PrivateResource=
                        ResourceIncludes=
                        MakeIncludes=
                        Compiler=
                        CppCompiler=
                        Linker=
                        IsCpp=1
                        Icon=
                        ExeOutput=
                        ObjectOutput=
                        OverrideOutput=0
                        OverrideOutputName=
                        HostApplication=
                        Folders=
                        CommandLine=
                        UseCustomMakefile=0
                        CustomMakefile=
                        IncludeVersionInfo=0
                        SupportXPThemes=0
                        CompilerSet=0
                        CompilerSettings=
                        
                        [Unit1]
                        FileName=main.cpp
                        CompileCpp=1
                        Folder=
                        Compile=1
                        Link=1
                        Priority=1000
                        OverrideBuildCmd=0
                        BuildCmd=
                        
                        [VersionInfo]
                        Major=0
                        Minor=1
                        Release=1
                        Build=1
                        LanguageID=1033
                        CharsetID=1252
                        CompanyName=
                        FileVersion=
                        FileDescription=Developed using the Dev-C++ IDE
                        InternalName=
                        LegalCopyright=
                        LegalTrademarks=
                        OriginalFilename=
                        ProductName=
                        ProductVersion=
                        AutoIncBuildNr=0

                        Makefile…

                        # Project: Project1
                        # Makefile created by Dev-C++ 4.9.9.2
                        
                        CPP  = g++.exe
                        CC   = gcc.exe
                        WINDRES = windres.exe
                        RES  = 
                        OBJ  = main.o $(RES)
                        LINKOBJ  = main.o $(RES)
                        LIBS =  -L"C:/Dev-Cpp/lib" -mwindows  
                        INCS =  -I"C:/Dev-Cpp/include" 
                        CXXINCS =  -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include" 
                        BIN  = Project1.exe
                        CXXFLAGS = $(CXXINCS)  
                        CFLAGS = $(INCS)  
                        RM = rm -f
                        
                        .PHONY: all all-before all-after clean clean-custom
                        
                        all: all-before Project1.exe all-after
                        
                        
                        clean: clean-custom
                        	${RM} $(OBJ) $(BIN)
                        
                        $(BIN): $(OBJ)
                        	$(CPP) $(LINKOBJ) -o "Project1.exe" $(LIBS)
                        
                        main.o: main.cpp
                        	$(CPP) -c main.cpp -o main.o $(CXXFLAGS)

                        As you can see this contains only the source file, and still produces the same error.

                        Member Avatar

                        17 Years Ago

                        So is your main.cpp file in the same directoty as the .dev file and the make file?

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Yes all of the files that have something to do with the project are stored in the same directory..source, resource, header, object, makefile, project, icons (this brand new project in C: only has a project file and source file and the makefile that is created..)

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Do you have any idea about the problem or could you recommend me to try somewhere else please? I have tried on the IRC channel but the 2 people who ever replied didnt know and I did not get a solution ont he bloodshed forum…If not can you recommend any more free compilers that I could try to use?…Thanks for your help.

                        Member Avatar

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Ok, thanks a lot for all of your help on this…I will try something new, I will post back if I ever solve the problem..

                        Member Avatar


                        bops

                        1



                        Posting Whiz in Training


                        17 Years Ago

                        Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…

                        Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4'
                        Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'

                        Im sure I have had these before when actually using the IDE…but I cant remember how to correct them…do you know how ? (these functions are within libraries that require me only to include windows.h I think…which I have)

                        Member Avatar

                        17 Years Ago

                        Hi again everyone, Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im not getting anywhere with it…I am interested in working with Windows Programming in C/C++ at the moment and every project I try to compile gives the same error…

                        C:Dev-CppCurrent_ProjectMakefile.win [Build Error]  [main.o] Error 1

                        and this is my compile log

                        Compiler: Default compiler
                        Building Makefile: "C:Dev-CppCurrent_ProjectMakefile.win"
                        Executing  make...
                        make.exe -f "C:Dev-CppCurrent_ProjectMakefile.win" all
                        g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -pg -g3
                        
                        The system cannot find the path specified.
                        
                        make.exe: *** [main.o] Error 1
                        
                        Execution terminated

                        I have tried many times re-installing the program aswell as re-configuring it and installing with fresh configurations etc…nothing seems to work, I get the same error over and over again…anyone know why or how to overcome it ?

                        I was getting this EXACT same error, and i fixed it by renaming my initial file from test to test.cpp (duuhh) and moving the project into a different folder Dev-Cppprojects

                        In my case it seems it was just the stupppid mistake of creating the new file and not renaming it properly.


                        cheers ;)

                        Member Avatar


                        WolfPack

                        491



                        Posting Virtuoso



                        Team Colleague


                        17 Years Ago

                        Hi again…I have found out how to compile and link my program, I can only do it step by step using the command line but it works like that…however Im getting lots of error messages like these…

                        Main.o(.text+0x28d):Main.c: undefined reference to 'GetStockObject@4'
                        Main.o(.text+0x311):Main.c: undefined reference to 'GetOpenFilename@4'

                        Im sure I have had these before when actually using the IDE…but I cant remember how to correct them…do you know how ? (these functions are within libraries that require me only to include windows.h I think…which I have)

                        I dont use dev-cpp, only MSVC++. Including windows.h is okay for compilation, but you should specifythe required libraries when you link them in the command prompt. For the MSVC I use something like cl main.cpp /link user32.lib gdi32.lib You would need to do something like that in dev-cpp also.


                        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.

                        New issue

                        Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

                        By clicking “Sign up for GitHub”, you agree to our terms of service and
                        privacy statement. We’ll occasionally send you account related emails.

                        Already on GitHub?
                        Sign in
                        to your account


                        Closed

                        aspencerpsu opened this issue

                        Dec 20, 2016

                        · 6 comments

                        Assignees

                        @Mizux

                        Comments

                        @aspencerpsu

                        I’m having debugging issues when using the nmake visual studio compiler tool to build the dependencies for the ORSOLVERS to work:

                         makefile(336): fatal error U1000: syntax error: ')' missing in macro invocation n stop
                        

                        I’ve filtered through the entire script with the naked eyes and used notepad++ api to detect any missing braces, and the results came back with nothing, are you sure you guys tested building the source through Visual Studios API? I have a X64 windows 10 machine and have all the PATH files correctly configured

                        @dlahlou

                        Hello Akeem,
                        Thank you for reaching out.
                        Did you clone the code from git or downloaded the archive? Which command
                        did you run before getting this error?
                        Regards

                        On Dec 20, 2016 16:56, «Akeem Spencer» <notifications@github.com> wrote:

                        I’m having debugging issues when using the nmake visual studio compiler
                        tool to build the dependencies for the ORSOLVERS to work:

                        makefile(336): fatal error U1000: syntax error: ‘)’ missing in macro
                        invocation n stop

                        I’ve filtered through the entire script with the naked eyes and used
                        notepad++ api to detect any missing braces, and the results came back with
                        nothing, are you sure you guys tested building the source through Visual
                        Studios API? I have a X64 windows 10 machine and have all the PATH files
                        correctly configured


                        You are receiving this because you are subscribed to this thread.
                        Reply to this email directly, view it on GitHub
                        <#293>, or mute the thread
                        <https://github.com/notifications/unsubscribe-auth/ASwpfGB6_l5u5VC_6TkjP3V2KavblkaPks5rJ_qogaJpZM4LR_Xh>
                        .

                        @aspencerpsu

                        @dlahlou

                        @Masuzu

                        Hello,

                        The thing is that there is no «make» executable provided with Windows VS suite but only nmake.

                        @furnon

                        @Mizux

                        Should be fixed on HEAD now

                        Понравилась статья? Поделить с друзьями:
                      • Makefile ignore error
                      • Makefile error exit
                      • Make ошибка 127
                      • Make verbose error
                      • Mape ошибка прогноза