Author Topic: How to produce "-I" option for a large number of sub folder on slickedit?  (Read 4639 times)

abcd

  • Guest
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?
« Last Edit: December 19, 2008, 02:09:38 am by abcd »

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
Re: How to compile a file including many head files in different sub folders?
« Reply #1 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.

abcd

  • Guest
Re: How to compile a file including many head files in different sub folders?
« Reply #2 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?
« Last Edit: December 19, 2008, 02:14:10 am by abcd »

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: How to produce "-I" option for a large number of sub folder on slickedit?
« Reply #3 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?

thefrogger

  • Community Member
  • Posts: 38
  • Hero Points: 2
Re: How to produce "-I" option for a large number of sub folder on slickedit?
« Reply #4 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.