How to include header files with different extensions

Hi,
When i include a header file with extension .ch (myincludefile.ch), the compiler gives error messages but when i change the extension to .h, the problem disappears.
Can anyone help me getting rid of this problem?
For example, for the line below, I get a warning such as, "attempt to redefine MY_CONST without #undef". Remember when i change the extension to .h, the problem disappears.
#define MY_CONST 500 /* Constant */
Thank you very much

I don't see how the name of the file could cause or prevent error messages, except when template declarations are involved. So let's assume for now that the file has a template declaration.
The Templates chapter of the C++ Users Guide explains about including or separating template declarations and their definitions.
If you have only a template declaration in a file and the compiler needs the definition, it will look for another file with the same base name and include it automatically. For example, if you have files foo.h and foo.cc, and foo.h has a template declaration, the compiler will include foo.cc automatically, even if you didn't intend for that to happen. You can wind up with multiple delcaration errors that way.
When looking for a file containing template definitions, the compile will not include a .h file, so as not to create recursive inclusion. If changing the file name to .h causes your problem to disappear, it seems like an unwanted automatic inclusion is the problem.
You can try two things to find out:
1. Compile with the -H option. The compiler will output an indented list of all included files. See if you are getting a file you didn't intend, or the same file twice.
2. Compile with option -template=no%extdef. It disables the automatic search for template definitions.
If you find an unintended included file this way, you will probably have to change the names or organizaiton of some of the files. Our implementation of the C++ standard library depends on NOT using the -template=no%extdef option, which might mean you can't use that option.

Similar Messages

  • How to include header files from different directories?

    Hi,
    Sorry for the newb question, but I can't figure this out. I'm trying to compile a simple piece of code (C++) that uses header files in a directory different from the Project directory; header files are in /opt/csw/postgresql/include/pqxx. I've tried a few different things, adding that directory to the include directives under Resource Files, add existing files from a folder, etc etc. Whenever I try to build, dmake bails with status -1. I can't seem to get this working, can someone explain how to use header files from different directories?
    Thanks,
    SlowToady

    Header files are usually specified relative to a base directory. If the base directory is not a system directory -- /usr/include or the compiler installation directory -- add a command-line directive
    -I path/to/base/dirfor each such directory.
    The path can be absolute, such as
    -i /opt/csw/postgresql/includeor relative, such as
    -I ../../my/includeIn your source code, specify the header file relative to the base directory, and be sure to use quotes, not angle brackets. Example:
    #include "header.h"  // right
    #include <header.h>  // wrongThe angle brackets are used for system headers, like <iostream> or <stdlib.h>.
    The rules above are common to all compilers on Unix and Linux, and generally to all C and C++ compilers.
    For more details, read about the -I option in the C++ Users Guide. You can find the guide by pointing your browser to the "docs" directory in the compiler installation, or go here:
    http://docs.sun.com/app/docs/doc/819-5267
    All command-line options are described in Appendix A.

  • How to open a file with the extension x3f (sigma)

    how to open a file with the extension x3f (sigma)?

    RAW data from the following Sigma cameras is currently supported:
    DP1
    DP1s
    DP2
    SD9
    SD10
    SD14
    If your camera is among these, then simply import the photo as usual. https://helpx.adobe.com/lightroom/help/importing-photos-lightroom-basic-workflow.html

  • How to convert audio files with caf extension to wav

    Hi all!
    I have some audio files with .caf extension that I need to convert to wav. How can I do that?
    Any batch audio converter around?
    Thanks!
    nz_

    Try "Easy CAF Converter for Logic Pro" on the Mac App Store.
    According to an app description,
    "The Easy CAF Converter for Logic Pro automatically converts Apple Loops installed with Logic Pro 9 and X to uncompressed audio formats (aiff and wave).
    With the Easy CAF Converter for Logic Pro, musicians using other major DAWs (e.g., Cubase, ProTools, Ableton Live, and Studio One, etc.) can now easily use the rich set of apple loops of Logic Pro in their music productions."
    App Store location:
    https://itunes.apple.com/us/app/easy-caf-converter-for-logic/id851083620?l=ko&ls =1&mt=12

  • How do I download files with .dds extension in Adobe Elements 11?

    I am trying to download a file with a .dds extension but I can't open the file. I've been told this can be down on the Adobe Photoshop element version 8, so I would assume version 11 can do it as well. Do I need a plug in to do this and if so, what kind? Thanks.
    Pigeon girl

    Try the free irfanview instead:
    http://www.irfanview.com

  • Read multiples files with same extension

    how to read multiples files with same extension in java.
    for ex : i would like to read all .DAT files from C drive using java.
    How is it done

    - You create the filter
    - You get the list of files
    - You open and read each file.
    For the first two above you look at java.io.File and listFiles(FileFilter filter).
    For the third you find whatever input stream is appropriate from java.io.*

  • Reading & Writing files with same extension(like ".sas", ".txt" , ".csv",and ".log" in Adobe AIR

    Hi Folks,
    How to read & write files with same extension(like ".sas", ".txt" , ".csv",and ".log" in Adobe AIR.
    Please let me tell if anybody knows asap.
    Thanks & Regards,
    Anderson

    Thanks Jon,
    But, I know how to read the file if we give exact file path
    I need to get the path  and  read file(s) with same extension files in the same folder using adobe air, not single file.
    Don't have file path even, i have folder path,  in that somany files are there. So i need to get which are the same extension(Ex: ".txt", ".sas") files
    If you have any idea , please help me out
    Regards,
    Vijay.

  • How to generate a second csv file with different report columns selected?

    Hi. Everybody:
    How to generate a second csv file with different report columns selected?
    The first csv file is easy (report attributes -> report export -> enable CSV output Yes). However, our users demand 2 csv files with different report columns selected to meet their different needs.
    (The users don't want to have one csv file with all report columns included. They just want to get whatever they need directly, no extra columns)
    Thank you for any help!
    MZ

    Hello,
    I'm doing it usually. Typically example would be in the report only the column "FIRST_NAME" and "LAST_NAME" displayed whereas
    in the csv exported with the UTL_FILE the complete address (street, housenumber, additions, zip, town, state ... ) is written, these things are needed e.g. the form letters.
    You do not need another page, just an additional button named e.g. "export_to_csv" on your report page.
    The csv export itself is handled from a plsql procedure "stored procedure" ( I like to have business logic outside of apex) which is invoked by pressing the button "export_to_csv". Of course the stored procedure can handle also parameters
    An example code would be something like
    PROCEDURE srn_brief_mitglieder (
         p_start_mg_nr IN NUMBER,
         p_ende_mg_nr IN NUMBER
    AS
    export_file          UTL_FILE.FILE_TYPE;
    l_line               VARCHAR2(20000);
    l_lfd               NUMBER;
    l_dateiname          VARCHAR2(100);
    l_datum               VARCHAR2(20);
    l_hilfe               VARCHAR2(20);
    CURSOR c1 IS
    SELECT
    MG_NR
    ,TO_CHAR(MG_BEITRITT,'dd.mm.yyyy') AS MG_BEITRITT ,TO_CHAR(MG_AUFNAHME,'dd.mm.yyyy') AS MG_AUFNAHME
    ,MG_ANREDE ,MG_TITEL ,MG_NACHNAME ,MG_VORNAME
    ,MG_STRASSE ,MG_HNR ,MG_ZUSATZ ,MG_PLZ ,MG_ORT
    FROM MITGLIEDER
    WHERE MG_NR >= p_start_mg_nr
    AND MG_NR <= p_ende_mg_nr
    --WHERE ROWNUM < 10
    ORDER BY MG_NR;
    BEGIN
    SELECT TO_CHAR(SYSDATE, 'yyyy_mm_dd' ) INTO l_datum FROM DUAL;
    SELECT TO_CHAR(SYSDATE, 'hh24miss' ) INTO l_hilfe FROM DUAL;
    l_datum := l_datum||'_'||l_hilfe;
    --DBMS_OUTPUT.PUT_LINE ( l_datum);
    l_dateiname := 'SRNBRIEF_MITGLIEDER_'||l_datum||'.CSV';
    --DBMS_OUTPUT.PUT_LINE ( l_dateiname);
    export_file := UTL_FILE.FOPEN('EXPORTDIR', l_dateiname, 'W');
    l_line := '';
    --HEADER
    l_line := '"NR"|"BEITRITT"|"AUFNAHME"|"ANREDE"|"TITEL"|"NACHNAME"|"VORNAME"';
    l_line := l_line||'|"STRASSE"|"HNR"|"ZUSATZ"|"PLZ"|"ORT"';
         UTL_FILE.PUT_LINE(export_file, l_line);
    FOR rec IN c1
    LOOP
         l_line :=  '"'||rec.MG_NR||'"';     
         l_line := l_line||'|"'||rec.MG_BEITRITT||'"|"' ||rec.MG_AUFNAHME||'"';
         l_line := l_line||'|"'||rec.MG_ANREDE||'"|"'||rec.MG_TITEL||'"|"'||rec.MG_NACHNAME||'"|"'||rec.MG_VORNAME||'"';     
         l_line := l_line||'|"'||rec.MG_STRASSE||'"|"'||rec.MG_HNR||'"|"'||rec.MG_ZUSATZ||'"|"'||rec.MG_PLZ||'"|"'||rec.MG_ORT||'"';          
    --     DBMS_OUTPUT.PUT_LINE (l_line);
    -- in datei schreiben
         UTL_FILE.PUT_LINE(export_file, l_line);
    END LOOP;
    UTL_FILE.FCLOSE(export_file);
    END srn_brief_mitglieder;Edited by: wucis on Nov 6, 2011 9:09 AM

  • How do you include other files with Muse publish to business catalyst test site

    Hi there
    I am trying to publish a site created in muse to the business catalyst test website service for a client to review
    in the website i created an animation that i have inserted as an HTML snippet (ie copied relevant code into "INSERT HTML"
    The question is how do include the folder with all the files required to run the animation when i click "PUBLISH" to business catalyst?
    thanks

    --deleted--
    Sorry, figured it out.

  • I am trying to find out how to assign files with particular extensions to the appropriate software. At the moment when I create a file using Word it is apparently given the extension .docx but Word doesn't recognise its own files. How do I alocate th

    I am trying to find out how to assign files with particular extensions to the appropriate software. At the moment when I create a file using Word it is apparently given the extension .docx but Word doesn't recognise its own files. How do I allocate the extension .docx to Word? There used to be a way of doing it, I think under "Preferences" but I can't seem to find it.

    Still in the same location:
    File > Get Info > Open with (select) > Change All (button)

  • How to open a file with a .bbb extension?

    How do you open a a file with .bbb extension on a Mac?

    ibopyoubopwebop wrote:
    What happens if i decide to buy a non BB phone.
    You can restore only to a BlackBerry device, and then once you copied what you wanted to the storage of your choice (computer or cloud). you can then copy it to whatever device you choose.
    But to get the information from the backup file, you will need to use a BlackBerry 10 device
    Using the Playbook and the Z10 and the Z30 and loving them
    Martin

  • I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    I have a problem with the mac can not read video files with the extension IMOD. How can I solve this problem?

    By doing a Google search. 

  • How do I make ALL files with RTF extension open in Nisus Writer?

    How do I make ALL files with RTF extension open in Nisus Writer? Right now it opens in Text Edit. I don't want to change it for one file. I want all files, regardless of how many or where they are.

    select a .rtf file in finder and enter command+i. in the resulting popup go to the "open with" section and change the app to open it to Nisus Writer and click "Change All".

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

  • How do I add a filter in JFileChooser for files with no extension?

    Is it possible to have a filter with that filters out files with no extension in a JFileChooser?
    Any help is appreciated.
    Shankar

    When you override accept(File), get the filename from the File object, and parse out the extension. I don't remember there being an easy way to get the extension besides looking for a dot and parsing. If there's no extension, accept it.

Maybe you are looking for

  • Dunning letter emailed or print by customer

    Hi, We are on 12.1.3, 11g database. Is there a way to control whether a dunning letter can be Printed or Emailed at the customer level. Dunning plans allow us to send letters by email or print, but there is no control as to which customer gets is as

  • Get still image, but no motion video via firewire. Help!

    This is really kicking me in the behind. I'm trying to do a print to tape, but before I get to that stage I have this problem where I can see my timeline video play fine in the canvas and I can see the still frame that I'm sitting on on the NTSC moni

  • Average number of a line

    Hey folks! I have a table with names of people in the left column and things they did to raise money in the headline (e.g. selling chocolate or cake). For each activity someone participates in, the person gets a X. Now i would like to calculate numbe

  • Difference between 2 dates in form of years,months and days.

    Hi friends,   i need one function module for finding difference between 2 dates and the output is no. of years no.of months no. of days. it means the input is begin date and end date output is no.of years,no.of months and no.of days. for example begi

  • Trouble with menus, scene markers and stop markers

    I am using Adobe Premier Elements 7, and Vista home premium. During playback: Scenes selected from a main or a sub menu play fine, and then the project plays into the next scenes, without ever going back to the menu again. This happens with main menu