No such file or directory dev cpp

Dev-C++ Discussion

Hello: I downloaded Dev C++ from Bloodshed to compile and run my c++ code. One of my headers for my main.cpp is #include «stdafx.h» Unfortunately, this is not recognized by Dev C++, so I added a header file named stdafx.h to the same folder where my main.cpp sits. I also included the header files referenced by my stdafx.h in the same folder. Is this the correct approach? Because when I go to compile my main.cpp, I am still getting the error that the header files (i.e., afxwin.h, afxext.h) for my stdafx.h cannot be found. I would greatly appreciate your help as it has been several years since I coded in C++ and first time using Dev C++. Thank you in advance. I have included the text of my stdafx.h below. // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

include // MFC core and standard components

include // MFC extensions

ifndef _AFX_NO_AFXCMN_SUPPORT

include // MFC support for Windows 95 Common Controls

endif // _AFX_NO_AFXCMN_SUPPORT

The compiler error was: C:\Documents and Settings\Guest BCox\My Documents\Dev C++\/stdafx.h:8:64: afxwin.h: No such file or directory
C:\Documents and Settings\Guest BCox\My Documents\Dev C++\/stdafx.h:9:46: afxext.h: No such file or directory

Читайте также:  Язык разметки html справочник

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

This guy wants to compile mfc code. The only way i know is by using Microsoft Visual C++. even if u dont want to buy the compiler u can still use the free express edition and Force it to compile MFC code: Check out this link on compiling MFC code on the free Visualstudio express edition http://www.codeproject.com/KB/MFC/MFCinVisualStudioExpress.aspx follow the steps given. and voila!! your code executes, which is what u are looking for right? wish u sucess 🙂

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Please post your full Basic 3, they are covered in the thread titled «Please Read Before Posting a Question». Now, one other thing. Code written for Microsoft compilers will usually not work out of the box. Wayne

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

stdafx.h is not ‘available’, it is project specific. It is an automatically generated file created when you use the Project Wizard creation in Microsoft VC++ (where presumably this code came from). It serves almost no purpose other to martial precompiled headers (a feature that Dev-C++ does not have and is of dubious benefit in any case). Often it is not required, even in VC++, but the IDE creates it in any case. The cynical would suggest that it is a way of locking in users to their development tool by making code fail to build in other tools. I suggest that you start by deleting the line that includes stdafx.h. It is possible that is all you need do; it depends on what functions your code calls. If it uses Win32 API calls, macros or structures, you will at least need . If it uses MFC classes (and the stdafx.h you posted indicates that it does), you haven’t a hope, and will need a Microsoft tool. Note that the free MSCV++ 2008 Express does not support MFC, but the .NET is better in any case, regard MFC as deprecated. Finally don’t put your projects in «C:\Documents and Settings\Guest BCox\My Documents\Dev C++\"; Dev-C++ does not always play well with paths containing spaces. Clifford

Читайте также:  Php simplexml в массиве

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

I have changed the directory path as you will find in the compile log: Compiler: Default compiler
Executing g++.exe.
g++.exe «C:\Dev-Cpp\Projects\SSP\main.cpp» -o «C:\Dev-Cpp\Projects\SSP\main.exe» -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» -L»C:\Dev-Cpp\lib»
In file included from C:\Dev-Cpp\Projects\SSP\main.cpp:1:
C:\Dev-Cpp\Projects\SSP\/stdafx.h:8:64: afxwin.h: No such file or directory
C:\Dev-Cpp\Projects\SSP\/stdafx.h:9:46: afxext.h: No such file or directory
C:\Dev-Cpp\Projects\SSP\/stdafx.h:11:68: afxcmn.h: No such file or directory
C:\Dev-Cpp\Projects\SSP\main.cpp:8: error: _TCHAR’ has not been declared C:\Dev-Cpp\Projects\SSP\main.cpp:9: error: ISO C++ forbids declaration of argv’ with no type Execution terminated

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

> I have changed the directory path as you will find in the compile log: I recommend that you move c:\dev-cpp\projects to c:\projects or anywhere not within c:\dev-cpp. Apart from polluting the installation being a bad idea in any case, there is a known problem with Dev-C++ that sometimes causes builds to fail when in c:\dev-c++\ subfolders — don’t ask me why! Anyway, the suggestion was not intended as a solution, it is merely to avoid other unrelated problems later. You still have not removed the include (which was intended as a solution), or clarified whether or not this is an MFC project (in which case the solution won’t work). Clifford

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

include «stdafx.h»

include «lmdif.hpp»

This .cpp is Levenberg-Marquardt routine/prgrm. It was written for Visual C++ 2005. It calls on the type `_TCHAR’ that is found in the .h files referenced in stdafx.h. This prgrm runs on MS Visual Studio. I would like to use the code in Dev C++ as it is easier to use than Visual Studio. What should I do now?

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Its like I am talking and you are not listening. Repeating your problem does not help. Answer the questions, perform the suggestions, post the results. It is unlikely that we will fix this in one step, but you have to do thr first step if we are to progress! And as I have already said: 1) delete the line that includes stdafx.h.
2) Replace it with the necessary direct headers; you will at least need . Without seeing the code I could not possible tell you what you actually need to include. And you still have not said whether it requires MFC? You cannot use Dev-C++ for MFC apps. So if you just answer that question, we may be able to decide to stop now and not waste time. If it turns out that it does require MFC after I asked twice, you will have wasted time. > It calls on the type `_TCHAR’ that is found in the .h files
> referenced in stdafx.h. No it is not. At least not directly. Read the documentation: http://msdn.microsoft.com/en-us/library/c426s321(VS.71).aspx _TCHAR required to be included. So now replace:

include
include
include

rebuild the code and post the log (assuming it fails), then we’ll determine the next step. Of course, the other question is why are you changing compilers? Visual Studio is hardly «hard to use», and when it comes to debugging is far superior, and that is probably where you spend most of your development effort. Clifford

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Источник

Dev-C++ Discussion

When trying to compile I get the message below and stops compiling. If I compile in Cygwin all is well and the executable is made. So how does one get the winerror.h file? Dev-Cpp/include/ole2.h:8:22:winerror.h «No such file or directory»

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

I know since you are working on this, it all makes sense to you, but try to remember, the rest of us have not been sitting there with you. Starting with the basics REALLY helps us help you. The basics incldue: (1) What version of Dev are you using, with what OS?
(2) Providing a simple example program, focused on the problem you are having. as simple as possible. do not ask folks to debug a long program in place
(3) Provide a copy of your full compile log. This will tell us about how the compiler is set up/called/and what its paths are. very helpful in cases like this. Wayne

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

In my installation winerror.h is in the Dev-Cpp/include folder. Since the compiler has found ole2.h in that folder, this is not a path issue; winerror.h must be missing or misplaced in your installation your installation. First try a file search to see if for some reasoin it has been moved . If you have a cygwin version, you could use that; i.e. copy it to the Dev include folder, I believe they are the same Anders Norlander headers, but beware of version issues. However I would worry about how it got deleted or moved, and what else might be missing. If you have used one of those nasty utilites that seek out and remove duplicate files to save space, this may have removed the file because you had a Cygwin duplicate. Clifford

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Thanks Wayne I am new to all of this. Dec-Cpp 4.9.8.9 Win2K 266MHZ 96 MB ram #include
#include
#include int main() char fname[256];
char input_str[256];
char *tok;
std::ifstream inf; std::cout std::cin.getline(fname, 255);
inf.open(fname);
if (inf)
std::cout while (!inf.eof()) inf.getline(input_str, 255);
tok = strtok(input_str, «, «);
while (tok) std::cout tok = strtok(NULL, «, «);
>
>
return 0;
> Can’t cut and paste log data. How do I do it?

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Clifford,
Thanks for your input. I have just updated Dev-Cpp to 4.9.8.9 and figured that any missing files would refill. I guess not! I have no duplicate file seeker. The file does not show up in a search of cygwin either. I’m Warren by the way!

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

The right mouse button brings up the copy menu Warren. I recommend you check out the thread titled «The Forum FAQ — Please Read First» — it has a lot of useful information contributed by users, including how to ask questions, how to interpret your compile log, FAQ links. just a ton of neat stuff that really helps — an may even provoke questions — like who is this moron Wayne who keeps posting. Wayne

If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Источник

Проблема при компиляции в Dev C++..

Не хочет компилировать программу..вот текс ошибки:
Компилятор: Default compiler
Building Makefile: «C:\Dev-Cpp\Makefile.win»
Выполнение make.
make.exe -f «C:\Dev-Cpp\Makefile.win» all
g++.exe -c «../Documents and Settings/Администратор/Рабочий стол/main.cpp» -o «../Documents and Settings/Администратор/Рабочий стол/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: ../Documents and Settings/LфьшэшёЄЁрЄюЁ/¦рсюўшщ ёЄюы/main.cpp: No such file or directory
g++.exe: no input files

make.exe: *** [«../Documents and Settings/Администратор/Рабочий стол/main.o»] Error 1

Как исправить?? Ни как не могу скопилировать В файл .exe

пути с пробелами и кириллицей — зло

то, что у вас main.cpp находится прямо на рабочем столе- это вообще за гранью.

Dev C++ устарел, проект закрыт используй Code::Blocks (codeblocks.org).

Перенеси проект и IDE в папки с английскими названиями.

в C:\Dev-Cpp\Makefile.win на 2 строчке примерно будет написана версия Dev-C++ если она будет меньше 6.3, то сноси нахрен. Я поставил 4.9.9.2 (весит где-то 40Мб это чучело, пишет в установщике), то думал, что это последняя версия, а как только взглянул на то, что я притащил с пары из универа, так как пооооонял! 6.3 версия весит (450Мб) Вот и плюшки

Источник

Оцените статью