SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: abcd on December 18, 2008, 07:19:27 am

Title: How to produce "-I" option for a large number of sub folder on slickedit?
Post by: abcd on December 18, 2008, 07:19:27 am
For example, hello.c include 100 .h file, which separately exists in different sub folder of "include" folder, is there a convenience way to automatically produce "-I" option for all these sub folder when compiling on slickedit?
Title: Re: How to compile a file including many head files in different sub folders?
Post by: Phil Barila on December 18, 2008, 07:46:39 pm
That's not the way the C language works.  You have to give the compiler an explicit filename.  Some compilers have a "force include" command line switch that allows you to force the inclusion of a specific header in the compilation of every source file.  I have no idea if it would take a wildcard, but that might be one very non-portable way to manage it.  If you want it more portable, make yourself a "master header" that includes all the headers you need, so you only need to include the master in your hello.c file.
Title: Re: How to compile a file including many head files in different sub folders?
Post by: abcd on December 19, 2008, 02:00:16 am
Phil Barila, thank you very much!

My project is compiled with a makefile. The c header file exists on many different sub folder on "include" and "lib", and it's included in c file directly without the detail path, when compile it on linux shell with the makefile, it automatically produce these compile option such as " -I./include/library -I ./include/f1 -I./include/f2 ......", so the compiling is no error. But when compile in slickedit, it say "No such file or directory", because the "-I" option for these sub folder isn't produced. For the number of sub folder is large, manually add these sub folder to "include" option on project properties is inconvenient.
Is there some convenient way to add all sub folder of one folder to project "include" option?
Title: Re: How to produce "-I" option for a large number of sub folder on slickedit?
Post by: chrisant on December 19, 2008, 05:44:53 am
If the makefile specifies the directories already, can't you just copy/paste from the makefile into SE?
Title: Re: How to produce "-I" option for a large number of sub folder on slickedit?
Post by: thefrogger on December 19, 2008, 05:54:02 am
Or if the makefile already works, you can just have SlickEdit use it directly.

On the Build tab of Project Properties, use the "Build with user-maintained makefile" option.