Author Topic: How do I complile in SlickEdit v.9?  (Read 7740 times)

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
How do I complile in SlickEdit v.9?
« on: April 25, 2008, 11:31:40 am »
I have problems getting a simple program up and running and in particular how to write a compilestring. I read the QnA but that didn't help me much.

Problem:
By default it sais "nmake %n.obj", but when I compile, it sais "'nmake' is not recognized as an internal or external command, operable program or batch file" in the Command Line. - Is this correct or should I change this?


Additional info:
There is also one part of the help text that I don't get (given below). I use SE v.9, but the compile command uses nmake and when I try to compile it, it sais "'nmake' is not recognized as an internal or external command, operable program or batch file."

From the help text:
"For Visual C++ v5.x and v6.x, the default compile command uses the nmake program that requires a makefile (.mak extension). Visual C++ v5.x and v6.x do not automatically create a makefile for you. Use the Export Makefile menu item (Project > Export Makefile) in Visual C++ to create or update the makefile. For Visual C++ v5.x or higher, the default build and rebuild commands do not need a makefile."

- Should I use a make file or not, and if so, what should it look like?

Graeme

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 307
Re: How do I complile in SlickEdit v.9?
« Reply #1 on: May 02, 2008, 01:46:11 pm »
I have problems getting a simple program up and running and in particular how to write a compilestring. I read the QnA but that didn't help me much.

Problem:
By default it sais "nmake %n.obj", but when I compile, it sais "'nmake' is not recognized as an internal or external command, operable program or batch file" in the Command Line. - Is this correct or should I change this?


Additional info:
There is also one part of the help text that I don't get (given below). I use SE v.9, but the compile command uses nmake and when I try to compile it, it sais "'nmake' is not recognized as an internal or external command, operable program or batch file."

From the help text:
"For Visual C++ v5.x and v6.x, the default compile command uses the nmake program that requires a makefile (.mak extension). Visual C++ v5.x and v6.x do not automatically create a makefile for you. Use the Export Makefile menu item (Project > Export Makefile) in Visual C++ to create or update the makefile. For Visual C++ v5.x or higher, the default build and rebuild commands do not need a makefile."

- Should I use a make file or not, and if so, what should it look like?

Sorry, I forgot to check if anyone else answered this.

The error message you're getting about nmake indicates that slick is unable to find nmake.exe.  nmake.exe comes with visual C++ - you'll probably find it in your Visual C++ installation folder in a "bin" folder.  nmake.exe uses a make file to determine what object files/ source files must be linked/compiled to make the executable.  You need to tell slick how to find nmake.exe by adding the path to nmake.exe to your PATH environment variable (see control panel -> system -> advanced tab -> environment variables -> user variables) or in older versions of Windows, modify autoexec.bat.  Another way is to go into project properties and select the "tools" tab.  You will see a list including compile, build, rebuild etc.  Select the compile option and in the "command line" edit box you will see "nmake ...".  You could replace "nmake" with the full path to nmake  e.g. C:\VisualC++\VC6\bin\nmake.exe ..."

Similarly for the build and rebuild options you will probably need to tell slick how to find msdev.exe  - it should also be in your Visual C++ installation folder.  The compile command compiles a single source file.  The build command compiles any out of date object files and creates the executable.  In VC7 (I think), msdev was replaced with devenv.exe.

For the compile command to be able to use nmake, you need to have a make file.  Visual C++ will create a make file for you  - use the export -> makefile command in Visual C++ to create a make file.  The make file will have a .mak extension.  It has all the information that Visual C++ nmake.exe program needs to compile your source file.  The nmake.exe program needs to be able to locate the make file - if the default command you quote (nmake %n.obj) is correct, then nmake will look for the make file in the "current folder"  - in the project properties dialog, you can set the "current folder" in the "Run from dir" edit box.  Another way to specify the location of the make file is to use the /F switch when you invoke nmake  i.e. nmake.exe /F

In the slick project properties dialog tools tab, the command line that invokes nmake could have
nmake /F c:\projects\project1\project-name.mak ...

If you click the "right arrow" at the right hand end of the "command line" edit box, you'll see what %n and all the other % options mean.  You can also click the elipsis button and browse to the location of nmake.exe and slick will add the full path and name of nmake.exe to the command line edit box for you.

Hence, you don't have to understand make files because VC++ creates one for you.  You will need to update the make file whenever your project configuration changes  - e.g. you add files etc.  To update the make file you just use the export make file option in Visual C++ again.

HTH
Graeme
« Last Edit: May 02, 2008, 01:48:31 pm by Graeme »

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: How do I complile in SlickEdit v.9?
« Reply #2 on: May 09, 2008, 06:14:02 am »
Wonderful, Graeme!
I had almost given up... really appreciate this!

I hope I can help someone as much in the future :)