Compiler appears to include .cpp source instead/addition to .h header file

Numerous source files in our project depend upon unix/dcfPosixLocks.h and must be linked with the dcfPosixLocks.o that results from compiling unix/dcfPosixLocks.cpp. While all of these numerous sources files either directly or indirectly #include "unix/dcfPosixLocks.*_h_*" none of them ever #include "unix/dcfPosixLocks.*_cpp_*" (or any other non .h file for that matter). Yet, the C++ compiler incorrectly appears to include unix/dcfPosixLocks.cpp instead of (or in addition to) unix/dcfPosixLocks.h, for example when compiling dcfConstants.cpp (actual invocation and error below). Renaming unix/dcfPosixLocks.cpp to unix/dcfPosixLocks.c (or other names with C/C++ related file extensions) results in similar behavior. We first discovered this problem when we moved from a partially patched Studio 11 on Solaris 9 SPARC to an unpatched Studio 11 on Solaris 10 SPARC, i.e. it works fine on the old system. The problem remains after fully patching Studio 11 on Solaris 10 SPARC and even after fully patching Studio 12 on Solaris 10 SPARC. The implication is that one of the Studio 11 patches broke the C++ preprocessor and has of course been carried over into Studio 12. Since we use gmake to compile multiple sources concurrently, we ruled gmake out as a source of the problem by eliminating concurrent compilation (e.g. -j1 not -j2) and by tracing it to ensure that it was not deciding to compile unix/dcfPosixLocks.cpp (e.g. due to some implicit rule or something like that). Workaround #1, since the dcfConstants.cpp file contains no templates, is to separately preprocess and then compile, i.e. CC -E dcfConstants.cpp 1> .../dcfConstants.i and then CC -c dcfConstants.i -o .../dcfConstants.o. Of course, workaround #1 is dubious in general and completely unworkable where templates are involved. Workaround #2 is to move the unix/dcfPosixLocks.cpp file out of the include path (many of the directories in our include path contain both source and header files). Unfortunately, workaround #2 is problematic from a source control point of view... implies lots of source files being moved unnecessarily from one location to another to artificially distinguish them from header files, breaking historical chains in the process (granted, depends on the abilities of your source control software). Any thoughts or comments? We are hoping that somebody might be able to help us discover the errors in our ways, contribute additional workarounds, and/or confirm that this is in fact a compiler bug. I can try to provide more information as needed. Thank you in advance. -R
/opt/studio11/SUNWspro/bin/CC -G -KPIC -w -mt
-D_POSIX_PTHREAD_SEMANTICS -DCXX_SUNPRO -DDCF_NO_STD_MIN -g
-D_DEBUG -DDCF_ASSERTIONS_ABORT -DDCF_DEADLOCK_ABORTS -DDC F_EXCEPTIONS_ABORT -I. -I/export/home/buildsys/src/build/tmp.3/dcf1/inc
-I/export/home/buildsys/src/build/tmp.3/dcf1/platform/unix/solaris/inc
-I/export/home/buildsys/src/build/tmp.3/dcf1/platform/unix/solaris/inc
-I/export/home/buildsys/src/build/tmp.3/dcf1/platform/unix/inc
-Iunix/solaris -Iunix
-I/export/home/buildsys/src/build/tmp.3/dcf1/interfaces
-I/export/home/buildsys/src/build/tmp.3/dcf1/platform/unix/solaris/interfaces.overlay
-I/export/home/buildsys/src/build/tmp.3/dcf1/interfaces.overlay
-c dcfConstants.cpp -o Debug/unix/solaris/dcfConstants.o
"unix/dcfPosixLocks.*_cpp_*", line 72: Error:
dcfLocks::oAtomicAccessToLong is initialized twice.
"unix/dcfPosixLocks.*_cpp_*", line 103: Error:
dcfMutexAttributes::pSingleton is initialized twice.
2 Error(s) detected.
gmake[2]: *** [Debug/unix/solaris/dcfConstants.o] Error 2
gmake[1]: *** [all-r] Error 1
gmake: *** [build] Error 2

I'm having trouble understanding what change in Sun compilers or in Solaris could have resulted in the change in behavior you report.
For template code, Sun compilers have always used the automatic inclusion model described in the C++ Users Guide section 5.2, "Template Definitions".
Specifically, if you include a header foo.h that declares one or more templates, the compiler will automatically include foo.cpp (or foo.cc, foo.C, etc) if it needs a definition of one of those templates. That is, it assumes that template definitions missing from foo.h will be in foo.cpp.
Does that answer your question?

Similar Messages

  • VS2010: Why does my C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include does not get all the needed header files?

    Hello,
    I have installed VS2010 Professional. I have done a full install. The I install the 2010 redistributable and 2010 SP1. So I think I have installed all the needed products. But my include files has only 3 files :(. anmintrin.h, srv.h, wmiatlprov.h. My colleagues
    who have installed the same three products have some 200 header files. My guess these header files are coming from some SDK or so. I have 5.0, 6.0A, 7.0A. 7.1A, 8.0, 8.0A SDKS installed. What am I missing? 
    Please check this http://stackoverflow.com/questions/13656856/cant-get-visual-studio-c-include-file-excpt-h-to-get-installed and there the person tells to practically remove all and install all and another answer says just copy it. My hope is Microsoft
    might have a more logical and technical answer than doing something blindly without rhyme or reason
    A clear cut answer might help the community. 
    thanks
    ananda

    Hi Ananda Vardhana,
    What about your issue now?
    If you have resolved it, you can share the solution here, which will be beneficial for other members with the same issue.
    If you did not, whether you can provide us more information as Barry said for resolving this issue?
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Concerning header files and include files

    I presently have a site I created in Frontpage 2003, Gunshows-USA.com.  It has seperate pages for each state and month.  I had a header file called head.shmtl that I included on each page.  This allowed me to create one file and reuse it on 50 different pages.  I was also able to place it on the page in such a way that I could include it under the Title of the page and even iinsert an indiviual banner above the header.shtml.  Will I be able to do basically  the same thing with Dreamwaver 5.5s header and footer function?  If so, is there anything special I need to be aware of?

    I guess I didn't quite explain myself as well as I should have. 
    1st I had used include files on my site for a header and a footer but the site broke and when I got it back up it was necessary to load code for each header file to each page to get it to appear.  I am not presently using include files on the site.  The site was created in FrontPage 2003 and I intend on migrating it to Dreamweaver as soon as I know a little more about what I'm doing with DW
    2nd.  When I had the include files working I did NOT have to change everything on every page when I wanted to change something in the header or footer.  The way I have it set up now I do.
    3rd.  Going through different tutorials books, etc I see that I can create a file with a header, a body, and a footer from the templates that are built into the program.  An example is the 3 column fixed, header and footer. My question is, if I use this layout will that layout follow throughout the site and will I be able to basically do the same as I did when I was using includes?  Will a change to the header file change every header file?
    4th.  Can I position the header file sot that it has space above it.  Or another words can I have the header file appear in the middle of the page?
    5th.  Is if possible to have more than one header or footer file and be able to call the one I want or use all one after another?

  • I have added photos to My Photo Stream on my PC (Windows 7). They appear in the Uploads folder instead. They do not upload to iCloud. Am I doing something wrong?

    I have added photos to My Photo Stream on my PC (Windows 7). They appear in the Uploads folder instead. They do not upload to iCloud. Am I doing something wrong?

    Unfortunately, photo stream on a PC is iffy at best.  Many people have problems getting it to work properly, including myself.  A work around would be to use an app like PhotoSync on your PC, which can send photos wirelessly to the camera roll on any of your iOS devices on the same wifi network.  Once in the camera roll, you iOS device will be added to your photo stream.

  • ActionScript 3 compiler, asc, is now open-source

    In the latest nightly build of the Flex SDK is the as3
    compiler code!
    The ActionScript 3 compiler, asc, is now open-source! Added
    the source code for Flex 3's asc.jar, at
    branches/3.0.x/modules/asc. This code came from
    ssh://asteam.macromedia.com/hg/asc-flex3 and is what built the
    asc.jar that shipped with SDK 3.0.0.477, plus open-source copyright
    changes. It requires Java 1.5 to build and is not integrated with
    the build scripts for branched/3.0.x; this branch continues to have
    a prebuilt asc.jar in 'lib'.

    PHPAMF is not an Adobe product and for this you did not find anything here.
    Amfphp can properly serialize and deserialize complex types. In addition to objects and arrays, it supports resources from database connections, which means you can simply return mysql_query from your remote method and amfphp will know what to do with it. If the platform supports it (currently, Flash Remoting only), it can handle circular references and typed objects. It also supports simple remote debugging. Finally, amfphp comes with a service browser which allows you to test your services before creating a frontend.
    Regards, Giuseppe

  • Compiling with ant--getting 'Unknown Source' in my exceptions

    I am compiling using this ant stanza:
         <property name="src" value="src"/>
         <property name="resources" value="src/resources"/>
         <property name="target" value="target"/>
        <target name="compile">
               <javac sourcepath="" srcdir="${src}"
                      destdir="${target}"  compiler="javac1.5" debuglevel="lines,source">
                    <include name="**/*.java"/>
               </javac>   
             <copy todir="${target}/resources">
                 <fileset dir="${resources}"/>
               </copy>
        </target> Note the debuglevel="lines,source" specification. But I'm still getting 'Unknown Source' in exceptions in this code. Yes, I've done a clean compile. Yes, I checked, and it's recreating the files and the jars. I'm reasonably sure there aren't any other build.xml files I could be running.
    I don't see why this wouldn't work.

    I have the same problem. Even If I have something like this.
    <javac debug="on" debuglevel="lines,vars,source" ... />

  • Compiler options to include cert with debug AIR

    Hi,
    I asked this in the media server forum also, but it occurred to me it may be more specific to here: I'm building an AIR app against protected streams with the app recognised by the cert I use to compile.
    This works great, but for debug, the certs aren't included, so I can't see the streams in debug mode.
    Does anyone know any compiler options I can use to force the debugger compile to be authenticated in the same way?
    Thanks,
    G

    I'm having trouble understanding what change in Sun compilers or in Solaris could have resulted in the change in behavior you report.
    For template code, Sun compilers have always used the automatic inclusion model described in the C++ Users Guide section 5.2, "Template Definitions".
    Specifically, if you include a header foo.h that declares one or more templates, the compiler will automatically include foo.cpp (or foo.cc, foo.C, etc) if it needs a definition of one of those templates. That is, it assumes that template definitions missing from foo.h will be in foo.cpp.
    Does that answer your question?

  • Include my own libraries and header files when compiling Berkeley DB?

    Hi to All,
    I am a new user to this forum and a newbie to Berkeley DB as well.
    I want to use some functions from some of my header files inside the source code of Berkeley DB.
    I would really appreciate if anyone can help me in including my own header files and libraries in Berkeley DB before compiling and MAKE of Berkeley DB.
    The make file generated by running configure file is too large to undestand and make changes in. So is there any way to include my files in configuration script or Make file created after running configuration script?
    Imp information :
    db-4.7.25.NC.tar.gz + Ubuntu 8.04 + Libraries/Header files to be included are in C and C++.
    Thanks in advance.

    Hi to All,
    I am a new user to this forum and a newbie to Berkeley DB as well.
    I want to use some functions from some of my header files inside the source code of Berkeley DB.
    I would really appreciate if anyone can help me in including my own header files and libraries in Berkeley DB before compiling and MAKE of Berkeley DB.
    The make file generated by running configure file is too large to undestand and make changes in. So is there any way to include my files in configuration script or Make file created after running configuration script?
    Imp information :
    db-4.7.25.NC.tar.gz + Ubuntu 8.04 + Libraries/Header files to be included are in C and C++.
    Thanks in advance.

  • Problem while including the header file in C source code in CIN

    While Creating code interface node....
    In the C source code we are supposed to include the Header file "extcode.h".In my system i have installed
    Turbo C. I couldn't able to find the above header files.When i am trying to use the above header file i am getting error,what could be the reason

    Hi,
    You need to point your turbo C to ..\labview\cintools which is where you will find the extcode.h and other h file and also the lib file.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Do we have INCLUDE=JAVA CLASS AND INCLUDE=JAVA SOURCE OPTION IN DATA PUMP

    Hi All ,
    Can any one please tell me ,
    how to import only java class and java source from datapump export file.
    Include=java class or include=java source is not working ..
    Thanks in advance,
    Sanjeev.

    Duplicate post.
    datapump include option.
    Lock this thread

  • Adhoc Reporting using Data Sources instead of Report Model

    Hi Gurus,
    I'm working on SSRS 2008. I'm trying to create Adhoc Report using Report Builder 3.0. To select Data Source, both *.rsds and *.smdl are listed. I selected a Data Source which points to a SQL database. When I add New datasets, I'm able to add the fields and
    it automatically detect relationships (Joins) using Primary Key and Foreign Key defined in the tables. I'm also able to edit the query. I ran the report and it ran successfully.
    My question is I couldn't find any documentation regarding using Data Source for Adhoc Reporting. MS SQL documentation and forums insists that Report Model is required for Adhoc Reporting.
    Please let me know if someone tried to create Adhoc Report using Data Source instead of Report Model. While I understand there are more benefits using Report Model (define entities/attributes, show/hide entity/attributes, organize entities/attributes etc.),
    I just want to know if this is possible.
    Are there any known limitation using this method?
    Thanks In Advance!

    Hi Ereswaran,
    Yes, we can create ad hoc report using report using data source instead of Report Model. Ad hoc reports typically are used to answer a specific question at appoint in time, so consequently people don’t spend a lot of time arranging and formatting the data
    in a precise way. Other report development tools are available in Reporting Services to support more sophisticated reporting requirements.
    Using Report Builder, we can build a simple report that display data form a single data source as defined by a report model. This tool is most useful for business users who need access to information but lack the skills to write a SQL query. If we have full
    experience of SQL query, of course we can use data source instead of Report Model.
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    Charlie Liao
    TechNet Community Support

  • What could this mean? It keeps appearing on my console. 10/29/11 10:17:47.113 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:1257 (18) socket Too many open files

    10/29/11 10:29:17.285 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:209 (fe09000a) CTunTapMgr::openDevice
    10/29/11 10:29:17.285 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:1257 (18) socket Too many open files
    10/29/11 10:29:17.285 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:340 (fe09000b) CTunTapMgr::disableHostMgr
    10/29/11 10:29:22.286 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:259 (18) open Too many open files
    10/29/11 10:29:22.286 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:209 (fe09000a) CTunTapMgr::openDevice
    10/29/11 10:29:22.286 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:1257 (18) socket Too many open files
    10/29/11 10:29:22.286 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:340 (fe09000b) CTunTapMgr::disableHostMgr
    10/29/11 10:29:27.287 PM vpnagentd: [p:133  pp:1]: error - TunTapMgr.cpp:259 (18) open Too many open files
    What could this mean? It keeps appearing on my console. I"m trying to install a Fitbit Tracker and can't get it to recognize the device. wondering if this has something to do with it. Thanks!

    It means you've installed some kind of third-party VPN software that isn't working.

  • ShObjIdl.h compile error when including Photoshop SDK header?

    I develop photoshop plugins on both Mac 10.6 and Windows 7, now my code has been built and run successfully on Mac, but on Windows there are curious compile errors in a file "ShObjIdl.h", this is a Windows SDK header file. ( my VC++ version is 2010 ). It seems including some adobe SDK header file will cause the error. Is there someone who had met this? I guess some macro define conflicts.

    Sophie
    did your program work ok under 10.3.6? Is it just Tiger that gives the problem?
    I have not used xmlrpc but I have used Pro*C on OS X with no probelms.
    Where did the xmlrpc.h you are using come from? I could not find it on OS X on either Tiger or Panther. However I do find an xmlrpc.cp and a make file so I assume you would include a shared library from it in the make file for your program to be able to make the xmlrpc calls you need to.
    In general, the include files are in sub directories of /System/Library/Frameworks and it would be worth a grep -r for the declarations you want to include and put the path in the include parameter to proc.
    I hope this info helps.
    Paul

  • CS5 install issue? only appears to be a frame instead of filling the scree on Mac osx

    CS5 install issue? only appears to be a frame instead of filling the screen on Mac osx
    When I click on the middle it takes me back to the desktop

    Hi,
    I would recommend posting this query in the Adobe Photoshop forum.
    You will get a specific response relevant to this question.
    Thanks

  • My ipod wont appear on my itunes source list and it appears in my computer but then a pop up comes and says deviced timed out in windows??HELP PLEASE ASAP!

    I just got a 120 GB ipod classsic and it wont appear in my itunes source list and it appears in my computer.I have tired the 5 R's already.But a pop-up appears and says windows times out and i need to have my ipod for today.PLEASE HELP ME ASAP

    if you have just got it most places give ipods a 1year garuntee so take it back to the shop to have it looked at pls put this as correct answer

Maybe you are looking for

  • Designer editor

    In the Edit module component window under the User Text tab, when I click on the Text editor button the designer window close by itself. But earlier I used to get the notepad editor with the code in it. I checked under the Options menu for Text edito

  • Can we share apps and songs with two different apple IDs but the same computer?

    we both got an iPod Touch for Christmas and we have two seperate Apple IDs and I cant figure out if the music she has purchased and the music i have purchased can be combined. We are using the same computer (windows 7) and same user acct. We also hav

  • Explain the term 'If a quantity of goods received is not yet calculated'

    Hi SAP Experts I read the note: 212286-Overview note: Valuation during goods movements. In the end, it reads "Determination of credit posting to order during the goods receipt for production order During goods receipt for the production order, the va

  • Restarting project from beginning after failing quiz

    I have set up an exam at the end of my Captivate 7 project, but I am having trouble getting the performance that I need. I was hoping someone could give me some insight into achieving the performance I want. I have been able to achieve the following:

  • "Read" Triggers

    Are there such things as Read Triggers in Oracle 8i? My requirement is to write an entry to a transaction table every time a user views a row in a billable table (i.e. a pay-per-view system). It occurs to me that a row-level trigger based on the user