I downloaded Dev-Pascal and created a Windows application project, in a subdirectory of my Desktop directory, using the included template for that purpose. The compiler wanted me to include an icon so I did. Here is the error message I get:
cpp: Too many arguments
C:\Dev-Pas\bin\windres: C:\Documents and Settings\<My User Directory>\Desktop\Test of Dev-Pascal\TestOfDevPascalWindowsApp01\rsrc.rc:1: parse error
I notice that this error message has caused at least one bad review of Dev-Pascal posted on a CNet site. (However, the review did not suggest any solution.)
What is causing this error? I did not do anything fancy. I am using the make file generated by Dev-Pascal and the icon file used is from the C:\Dev-Pas\Icons directory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You have not given me much to go on. But I'm going to take a stab in the dark here. Since you just downloaded Dev-Pascal I'm guessing that the problem is this:
In the Free Pascal version of Dev-Pascal the Icon folder is incorrectly named 'Icons'. So what I want you to do is open up the Dev-Pas folder and rename it 'Icon'. Then let me know what happens.
See Ya
Butch
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Icon directory was misnamed as you suggested. I tried changing the name but got the same error message. The compile log contains the following:
Building resource file...
C:\Dev-Pas\bin\windres --include-dir C:\Dev-Pas\units\ --include-dir C:\Dev-Pas\units\rtl\ -i "C:\Documents and Settings\<my user directory>\Desktop\Test of Dev-Pascal\TestOfDevPascalWindowsApp01\rsrc.rc" -o c:\docume~1\<myusername>~1\desktop\testof~2\testof~1\rsrc.o --preprocessor cpp
The resource file contains the followig:
500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "C:\Dev-Pas\Icon\Window.ico"
Thank you for drawing my attention to the misnamed directory. Perhaps I am closer to a solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem may have to do with your path. Lets keep the path as short as possible. I want you to create a folder on your C:/ drive and called it: WinPas
Next select File > New Project > Windows Application > OK
Call Project: WinPrj and click OK.
Save the Project in the folder WinPas.
A Window called Untitled1 should appear in the Editor panel to the right in Dev-Pascal. This is a Windows skeleton, I want to use this for a check.
Select File > Save Unit and call this file: main
The name should change from Untitled1.pas to main.pas.
Click Execute > Compile and a window should appear. If the compilation was successful you can click the 'Execute' button and the program will run and an empty Window with a white background will appear with a title 'Windows App'. If it failed you can only click the 'Continue' button.
This is what my compiler log looks like after I've compiled the skeleton.
As you can see I have the Dev-Pas folder on the C:\ drive and I have no spaces in file or folder names. Spaces can sometimes cause problems so as a rule, it is a good idea to not have them in the path.
If yours is different then I want you copy your compiler log here again so we can compare them.
My resource files looks like this:
500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "C:\Dev-Pas\Icon\Mainicon.ico"
See Ya
Butch
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That worked. Was the length of the path name too long when I tried this the first time? Do I really need to use only short paths to my working directory? Thank you. At least I am now able to compile a Pascal program.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you. I see the problems with spaces in Dev-Pascal, but the comment about this problem being common to other compilers sparked some interest. I use Dev-C++ and have not had trouble putting my C and C++ projects in any directory--even those with paths containing spaces or in folders on my desktop. Thus, your comment about the trouble being exhibited by Dev-C++ has me wondering if I will have some significant trouble later with my C and C++ projects. One difference I notice is that Dev-C++ seems to offer more extensive controls over paths to required files (such as needed for includes and linker operation). Perhaps the reason I had better success with Dev-C++ is that I needed to specify paths for a project and the controls allowed me to completely specify the paths.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-09-18
The MinGW/GNU toolchain used by Dev-C++ is a collection of tools from more than one GNU project. In the past paths with spaces has been a problem to most of the tool chain components, over time the situation has improved with each new release, but these projects are very large and it is not guaranteed that they are compatible in all possible situations - we still see errors that are assiciated to this problem. Also there is no gurantee that a new release may not regress, breaking existing projects. So in all it is wise to avoid spaces in paths.
Also the way Linux handles spaces in paths differes from that used in Windows, so problems may arise because of this - the GNU toolchian is developed on Linux and ported to Win32 (on either Cygwin or MinGW - Cygwin fairs better because it is a Linux emulation layer, so the port is simple, MinGW is native Win32, so is more complex to port - which is probably where the errors occur).
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I downloaded Dev-Pascal and created a Windows application project, in a subdirectory of my Desktop directory, using the included template for that purpose. The compiler wanted me to include an icon so I did. Here is the error message I get:
cpp: Too many arguments
C:\Dev-Pas\bin\windres: C:\Documents and Settings\<My User Directory>\Desktop\Test of Dev-Pascal\TestOfDevPascalWindowsApp01\rsrc.rc:1: parse error
I notice that this error message has caused at least one bad review of Dev-Pascal posted on a CNet site. (However, the review did not suggest any solution.)
What is causing this error? I did not do anything fancy. I am using the make file generated by Dev-Pascal and the icon file used is from the C:\Dev-Pas\Icons directory.
Hi Everyone:
You have not given me much to go on. But I'm going to take a stab in the dark here. Since you just downloaded Dev-Pascal I'm guessing that the problem is this:
In the Free Pascal version of Dev-Pascal the Icon folder is incorrectly named 'Icons'. So what I want you to do is open up the Dev-Pas folder and rename it 'Icon'. Then let me know what happens.
See Ya
Butch
The Icon directory was misnamed as you suggested. I tried changing the name but got the same error message. The compile log contains the following:
Building resource file...
C:\Dev-Pas\bin\windres --include-dir C:\Dev-Pas\units\ --include-dir C:\Dev-Pas\units\rtl\ -i "C:\Documents and Settings\<my user directory>\Desktop\Test of Dev-Pascal\TestOfDevPascalWindowsApp01\rsrc.rc" -o c:\docume~1\<myusername>~1\desktop\testof~2\testof~1\rsrc.o --preprocessor cpp
The resource file contains the followig:
500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "C:\Dev-Pas\Icon\Window.ico"
Thank you for drawing my attention to the misnamed directory. Perhaps I am closer to a solution.
Hi again:
The problem may have to do with your path. Lets keep the path as short as possible. I want you to create a folder on your C:/ drive and called it: WinPas
Next select File > New Project > Windows Application > OK
Call Project: WinPrj and click OK.
Save the Project in the folder WinPas.
A Window called Untitled1 should appear in the Editor panel to the right in Dev-Pascal. This is a Windows skeleton, I want to use this for a check.
Select File > Save Unit and call this file: main
The name should change from Untitled1.pas to main.pas.
Click Execute > Compile and a window should appear. If the compilation was successful you can click the 'Execute' button and the program will run and an empty Window with a white background will appear with a title 'Windows App'. If it failed you can only click the 'Continue' button.
This is what my compiler log looks like after I've compiled the skeleton.
Building resource file...
Compiling files :
C:\Dev-Pas\bin\ppc386 C:\WinPas\main.pas -oc:\winpas\winprj.exe -S2 -Sg -Un -O1 -Op1 -FuC:\Dev-Pas\units\ -FuC:\Dev-Pas\units\rtl\ -FlC:\Dev-Pas\units-FlC:\Dev-Pas\units\rtl\ -FDC:\Dev-Pas\bin\ -WG -kC:\WinPas\rsrc.o
As you can see I have the Dev-Pas folder on the C:\ drive and I have no spaces in file or folder names. Spaces can sometimes cause problems so as a rule, it is a good idea to not have them in the path.
If yours is different then I want you copy your compiler log here again so we can compare them.
My resource files looks like this:
500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "C:\Dev-Pas\Icon\Mainicon.ico"
See Ya
Butch
That worked. Was the length of the path name too long when I tried this the first time? Do I really need to use only short paths to my working directory? Thank you. At least I am now able to compile a Pascal program.
Thank you. I see the problems with spaces in Dev-Pascal, but the comment about this problem being common to other compilers sparked some interest. I use Dev-C++ and have not had trouble putting my C and C++ projects in any directory--even those with paths containing spaces or in folders on my desktop. Thus, your comment about the trouble being exhibited by Dev-C++ has me wondering if I will have some significant trouble later with my C and C++ projects. One difference I notice is that Dev-C++ seems to offer more extensive controls over paths to required files (such as needed for includes and linker operation). Perhaps the reason I had better success with Dev-C++ is that I needed to specify paths for a project and the controls allowed me to completely specify the paths.
The MinGW/GNU toolchain used by Dev-C++ is a collection of tools from more than one GNU project. In the past paths with spaces has been a problem to most of the tool chain components, over time the situation has improved with each new release, but these projects are very large and it is not guaranteed that they are compatible in all possible situations - we still see errors that are assiciated to this problem. Also there is no gurantee that a new release may not regress, breaking existing projects. So in all it is wise to avoid spaces in paths.
Also the way Linux handles spaces in paths differes from that used in Windows, so problems may arise because of this - the GNU toolchian is developed on Linux and ported to Win32 (on either Cygwin or MinGW - Cygwin fairs better because it is a Linux emulation layer, so the port is simple, MinGW is native Win32, so is more complex to port - which is probably where the errors occur).
Clifford
What Clifford says is correct. Dev-C++ uses the GNU C compiler while Dev-Pascal uses the Free Pascal compiler. See http://www.freepascal.org/.
The folks at Free Pascal also don't recommend having spaces in paths names (See the FAQs:Genereal Information:6)Free Pascal Installation hints.)
See Ya
Butch
Good Morning:
The length of the path name isn't too long. The problem has to do with the path you were using.
Using path with spaces in them sometimes cause problems, as in 'Documents and Settings' and 'Program Files'.
Another problem is that you shouldn't put a file on the Desktop, as in '<myusername>~1\desktop', it also causes problems.
This isn't just true of Dev-Pascal, but also with Dev-C++ and with about any other compiler I've used.
Have fun.
See Ya
Butch