I've successfully compiled projects from scratch, but now I'm trying to compile a dll with project options set to "c project." I'm letting the default dllmain.c and dll.h files be saved in the default C:\Dev-Cpp\ directory. I have made no changes to the default settings under the "Tools" tab or any other settings.
The project files have not been modified at all. I'm simply trying to compile the skeleton files which are produced upon selecting dll using "c project" as stated above. The build fails, and I'm thinking it is something simple related to the Tools>Compiler Options>Directories settings, but I'd appreciate some helpful hints to get the project to compile.
Below is the full Compile Log output:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c dllmain.c -o dllmain.o -I"C:/Dev-Cpp/include" -DBUILDING_DLL=1
gcc.exe: dllmain.c: No such file or directory
gcc.exe: no input files
make.exe: *** [dllmain.o] Error 1
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've compiled a single, simple source file as a stand-alone build and separately as part of a project. In the stand-alone test, the build command which automatically executes includes the path to the source file.
...
g++.exe -c "C:\batch\testing\pathtest.cpp"
When I try to compile the identical "project" version of the source file, the g++.exe build command doesn't include the full path. It only includes the name of the source file, and the build fails (as can be seen in compile logs from above).
My solution was to go to Project>Project Options>Files>Override Build Command, and manually type in the full path within "". The build worked perfectly. No compile errors.
So the new question is this: Am I going to have to manually edit the build command every time I compile a new project so that the full path is passed, or am I still missing a simple setting? It doesn't make sense to me that to compile a simple source file (even with header files)the auto build command knows to g++.exe -c "the\entire\path\file.cpp", but when I try to manage the task as a formal "project" with the identical files, the auto build command only executes g++.exe -c file.cpp
Something about projects is causing the path to my source files to be lost.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Version 4.9.9.2 on Win XP Pro.
Let me refine what I stated in the above post:
In the past I have been able to create individual source files and header files, save them, compile them and run them with no problems at all. However, when I try to create a new "project" of any description at all, I get the compile fail messages like I stated above. It doesn't matter what type of "project" I create. It will not compile. I am certain I need to tweak a setting in my project options, but I've tried fumbling with directories and overriding build command with my own tweaks, but nothing works.
To test, I created a new project: File>New>Project>Console Application (using c++).
The default project consists of one file named main.cpp. I save main.cpp and try to compile.
// begin main.cpp here
// this is the default code created by dev-c++
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}
// end main.cpp here
Here is the Compile Log from trying to compile this project:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\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"
g++.exe: main.cpp: No such file or directory
g++.exe: no input files
make.exe: *** [main.o] Error 1
Execution terminated
//////////////////////////////////////////////////////
Here's the catch: I can start from scratch, not bothering to take the step of creating a new project, but instead simply creating a new empty source file. File>New>Source File.
I can copy/paste the code from above into the empty source file, name it something, and compile it with no trouble at all.
So here is the question: What in my project settings do I need to tweak to make my formal "project" files compile.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Version 4.9.9.2 on Win XP Pro.
I've successfully compiled projects from scratch, but now I'm trying to compile a dll with project options set to "c project." I'm letting the default dllmain.c and dll.h files be saved in the default C:\Dev-Cpp\ directory. I have made no changes to the default settings under the "Tools" tab or any other settings.
The project files have not been modified at all. I'm simply trying to compile the skeleton files which are produced upon selecting dll using "c project" as stated above. The build fails, and I'm thinking it is something simple related to the Tools>Compiler Options>Directories settings, but I'd appreciate some helpful hints to get the project to compile.
Below is the full Compile Log output:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c dllmain.c -o dllmain.o -I"C:/Dev-Cpp/include" -DBUILDING_DLL=1
gcc.exe: dllmain.c: No such file or directory
gcc.exe: no input files
make.exe: *** [dllmain.o] Error 1
Execution terminated
New info from new tests:
I've compiled a single, simple source file as a stand-alone build and separately as part of a project. In the stand-alone test, the build command which automatically executes includes the path to the source file.
...
g++.exe -c "C:\batch\testing\pathtest.cpp"
When I try to compile the identical "project" version of the source file, the g++.exe build command doesn't include the full path. It only includes the name of the source file, and the build fails (as can be seen in compile logs from above).
My solution was to go to Project>Project Options>Files>Override Build Command, and manually type in the full path within "". The build worked perfectly. No compile errors.
So the new question is this: Am I going to have to manually edit the build command every time I compile a new project so that the full path is passed, or am I still missing a simple setting? It doesn't make sense to me that to compile a simple source file (even with header files)the auto build command knows to g++.exe -c "the\entire\path\file.cpp", but when I try to manage the task as a formal "project" with the identical files, the auto build command only executes g++.exe -c file.cpp
Something about projects is causing the path to my source files to be lost.
Version 4.9.9.2 on Win XP Pro.
Let me refine what I stated in the above post:
In the past I have been able to create individual source files and header files, save them, compile them and run them with no problems at all. However, when I try to create a new "project" of any description at all, I get the compile fail messages like I stated above. It doesn't matter what type of "project" I create. It will not compile. I am certain I need to tweak a setting in my project options, but I've tried fumbling with directories and overriding build command with my own tweaks, but nothing works.
To test, I created a new project: File>New>Project>Console Application (using c++).
The default project consists of one file named main.cpp. I save main.cpp and try to compile.
// begin main.cpp here
// this is the default code created by dev-c++
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}
// end main.cpp here
Here is the Compile Log from trying to compile this project:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\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"
g++.exe: main.cpp: No such file or directory
g++.exe: no input files
make.exe: *** [main.o] Error 1
Execution terminated
//////////////////////////////////////////////////////
Here's the catch: I can start from scratch, not bothering to take the step of creating a new project, but instead simply creating a new empty source file. File>New>Source File.
I can copy/paste the code from above into the empty source file, name it something, and compile it with no trouble at all.
So here is the question: What in my project settings do I need to tweak to make my formal "project" files compile.