File-scope static declaration hides declaration in namespace

the following fails to compile:
// main.cpp
static int foo(int);
namespace FOO {
    int foo(int);
// blah, blah, blah implementation
// don't care whether this links
int
main(int argc,char* argv[])
    foo(1);
    return 0:
}returns:
Error: foo(int) is not a member of FOO.
This arises when compiling ACE w/ Sun Studio 9 C++ (5.6 Patch 117550-01):
OS_NS_sys_utsname.inl: Error: uname(utsname*) is not a member of ACE_OS.
Judging from the sys/utsname.h header file, I think this will only affect i386 (not sparc) builds since only then is uname defined statically.
I hadn't previously compiled ACE before applying the C++ compiler patch, so I don't know if this is new or old, but since I don't see anything wrong w/ the above code fragment or ACE, both of which compiler under other modern compilers (gcc 3.4.2), then I think it must be the compiler.
Any workaround ideas?

I don't mind helping you track down the problem. The command I used was just "CC -c" with no other arguments. (I used -c because the program won't link due to missing definitions.) I tried sparc and x86 versions.
Maybe your C++ implementation is corrupted. You can install multiple versions of Sun Studio on the same system, but each must be in a different base directory. If one release was installed in /opt, other releases must be installed elsewhere. If you install a new release on top of an existing release, you can have serious problems.
In addition, if you installed an Early Access version of a compiler, you must uninstall it before installing the official release.
Try running CC -V -c foobar.cc
The file foobar.cc does not need to exist.
You should see this:
CC: Sun C++ 5.6 Patch 117550-01 2004/10/12
ccfe: Sun C++ 5.6 Patch 117550-01 2004/10/12
Could not open input file "foobar.cc".
I searched bug reports for something like your test case, and didn't find an exact match. I did find a similar bug involving an extern "C" function in a namespace, but that bug was fixed in C++ 5.4.

Similar Messages

  • Static interface Vs Static nested interface declaration

    Hi,
    I have observed that static interface declaration is not allowed in Java. However static nested interface declaration is allowed.
    I could not understood reason behind this behavior.
    e.g.
    interface A{
         void AA();
         public static abstract interface Aa{
    } ........... this is allowed in Java.
    static interface d{
    } ...... This is not allowed in Java...
    I already know that static mean one for class and interface has only abstract method.
    Please let me know if any one know resign behind this.
    Thanks .

    Why don't you go to a Java forum?

  • Mofcomp.exe failed, delete the classes and retry compiling, 0x8004400a unexpected token at file scope, Primary DP will not validate

    I have SCCM 2012 R2 CU3. Before when I've had DP problems it was always with secondary DPs. Now I've got an issue with my primary DP. Content will not validate on the main DP, called DP1. In Monitoring Distribution Point Configuration Status there are repeated
    errors about "Failed to validate package ABC12345\\fqdn". On the site server in distmgr.log this entry repeats over and over:
    "Mofcomp.exe failed, delete the classes and retry compiling E:\program files\microsoft configuration manager\bin\64\smsdpprov.mof
    Failed to compile MOF file. Error code 2."
    The problem is I don't know what classes it's talking about, nor how to delete them, nor can I find anything directly applicable about this error. I did run "mofcomp.exe smsdpprov.mof" anyway but I get the error "error syntax 0x8004400a: unexpected
    token at file scope. Compiler returned error 0x8004400a."
    This DP1 was working fine until a few days ago. We haven't made any upgrades/changes to the server either.
    We sent a package just to DP1 and it did deploy the content, so it appears that it just can't validate.
    Thanks for any help.
    Ben JohnsonWY

    Hi,
    About the error in Mpcontrol.log, you could try to uninstall the MP, reinstall IIS components, then install MP to see if it can resolve this issue.
    If not, please have a look at the following blogs.
    Support Tip: ConfigMgr 2012 Management Point fails
    with a 500 error after working fine for a short period of time
    SCCM MP Internal Server Error ISS Call to HttpSendRequestSync
    failed for port 80 with status code 500
    From you description above, you reinstalled the DP. Did you reinstall the IIS components during the DP reinstallation? If not, please try to reinstall the IIS components.
    Best Regards,
    Joyce
    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.

  • How to import files with static variables into a block with methods?

    i have a problem. is it possible to import files with static variables into tags like
    <%!
    //here i want to import a file named settings.inc
    //whitch is used to set jdbc constants like url,driver,...
    private void method() {
    private void method2() {
    %>
    <%@include file="xy"%>//dosn�t work above
    //only in <%%>tag

    This should be done using either the Properties class or ResourceBundle. Ex.
    <%
    ResourceBundle resBun = ResourceBundle.getBundle(String resource);
    String username = resBun.getString("username");
    String password = resBun.getString("password");
    // etc
    %>

  • Uploading javascript file under static files

    We uploaded the javascript file under static files. By default the mime type is "application/octet-stream". We are accessing this js file in our application however this is not working.
    Is this because the mime type is "application/octet-stream"?
    Please let us know how to change the mime type to javascript.

    Actually, we were having the same problem and determined it to be an IE bug. If we upload the .js file using Firefox, it saves as the correct mime type, x-javascript. If we use IE8, it gets uploaded as octet. Because of this, Firebug did not recognize the file, we got the following error: "the resource from this url is not text: " with the link to the uploaded file. Hence, none of the functions included in the file worked in our application.

  • Why global var can be initialized with a static method and not by other static global var declared after its usage

    Take this:
    class test
    static int i=j;
    static int j=10;
    this will give illegal forward reference ....
    but this will compile successfully ..
    class test
    static int i=test1();
    static test1()
    return 20;
    plz assume we have main method in both cases ..
    java would be loading all static members first and would be assigning default values .. and then will be running all the initializers from to bottom ..
    Why second case is a compile success and not first .. as in second also test1 method is declared after its usage ..
    Plz help.
    Thanks
    Abhishek Roshan

    Why second case is a compile success and not first .. as in second also test1 method is declared after its usage ..
    Because the implementors of Java intentionally chose to do it that way.
    There are TWO stages to the process: preparation (which occurs first) and initialization.
    See the Java Language Spec section 12.4.1 'When Initialization Occurs
    The intent is that a class or interface type has a set of initializers that put it in a consistent state, and that this state is the first state that is observed by other classes. The static initializers and class variable initializers are executed in textual order, and may not refer to class variables declared in the class whose declarations appear textually after the use, even though these class variables are in scope (§8.3.2.3). This restriction is designed to detect, at compile time, most circular or otherwise malformed initializations.
    Note the clause beginning 'may not refer to class variables'. And the authors give the reason for that restriction in the last sentence: detect circular initializations.
    Then if you check that referenced section 8.3.2.3 you will find this
    http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.3.2.3
    8.3.2.3. Restrictions on the use of Fields during Initialization
    The declaration of a member needs to appear textually before it is used only if the member is an instance (respectively static) field of a class or interface C and all of the following conditions hold:
      The usage occurs in an instance (respectively static) variable initializer of C or in an instance (respectively static) initializer of C.
      The usage is not on the left hand side of an assignment.
      The usage is via a simple name.
      C is the innermost class or interface enclosing the usage.
    When a method is used (your example 2) no circular initialization can occur because methods are not 'initialized'.

  • Tree component - can I declaratively hide the disclosure icon

    I have just started working with the tree component. Within the data model that I am working with, I've got branches that may or may not contain children. The child nodes are lazily fetched (which is good, for performance), but this results in the tree not knowing if children exist until the disclosure icon (the arrow) is clicked. This means that when the branch contains no children, the user has to click the arrow, and the arrow just disappears without anything on the tree changing. Because of the nature of the legacy data model that I am working with, I actually have an attribute that indicates if children exist (and I could have created a formula based attribute if no such indicator existed in the data model). I would like to be able to check this attribute (via EL or some other method) and suppress the disclosure icon if no children exist, but I have not found a way of doing it. Is this possible?

    I was able to get this to work using the following disclosure listener:
      public void testDisclosureListener(RowDisclosureEvent rowDisclosureEvent) {
        Object rowKey = null;
        FacesCtrlHierNodeBinding rowData = null;
        RichTree tree = (RichTree)rowDisclosureEvent.getSource();
        RowKeySet rks = rowDisclosureEvent.getAddedSet();
        if (rks != null && rks.size() == 1) {
           rowKey = rks.iterator().next();
           tree.setRowKey(rowKey);
           rowData = (FacesCtrlHierNodeBinding)tree.getRowData();
           if ( rowData != null && rowData.getChildren() != null ) {
             // Iterate through the children of the expanded node and check if they have children
             for ( Object child : rowData.getChildren() ) {
               FacesCtrlHierNodeBinding childNode = (FacesCtrlHierNodeBinding)child;
               if ( childNode.getChildren() == null || childNode.getChildren().size() == 0 ) {
                 // Child node is a leaf.  Add it to the disclosed rows, to that the ADF tree will not display a disclosure icon
                 tree.getDisclosedRowKeys().add(childNode.getKeyPath());            
      }

  • Extern declaration in DECLARE DB_NAME DATABASE

    Hi
    I need to connect to 2 databases using Pro*C on Sun Solaris. We have our own lib which does EXEC SQL CONNECT :connstr. All the processes called the same function.
    Now i need to connect to one more DB in the same function. So i define the same as
    EXEC SQL DEFINE DB_NAME_2 DATABASE ;
    and then does the connect using AT option.
    Now when i need to fire the queries, I would include this DB Name as below
    EXEC SQL AT DB_NAME_2 SELCT .....
    For Default connection it is working fine.
    As the Connect function is different ( embedded in a lib ), the declaration has gone in the local function
    Now when i compile the Pro*C i get compilation error as
    Semantic error at line 1533, column 33, file Test.pc:
    EXEC SQL AT DB_DB_NAME_2 SELECT
    ................................1
    PCC-S-02331, undefined SQL identifier
    Can we have the DEFINE DB_NAME_2 Database as extern which we used in C ?
    Thanks & Regards

    You're doing this in scriptlets in a JSP? Very bad indeed.
    Servers don't fetch host or port or database. Which one is your JSP supposed to be using? The one that your server-side code connects to.
    "$FND_TOP/secure directory" - what's this? Is this a hosted site? If so, you need to talk to your host provider.
    %

  • Error When Uploading a CSS file or  Static file

    When I am uploading a CSS or Static file , I get the following error. But I can upload images files with no issues.
    ORA-02291: integrity constraint (FLOWS_FILES.WWV_FLOW_FILE_OBJ_FK) violated - parent key not found
    Oracle XE upgraded to Apex 3.1
    Please help
    George

    Yes, if you upload an image on a normal Oracle Apex Database its stored in the DB.
    But, if you remember, when you configire apex you specify an images directory /i/.
    Under this directory you will find all the images that apex uses as well as css files, etc.
    If you place your image in this directory you can reference it my modifying the appropriate stylesheet/template.
    So, for example, you cna place your own stylesheets in the appropriate directory on the server.

  • File Hyperlinks - How to hide the extension?

    Hi,
    I'm trying to link to a file but I'm finding that the format of the hyperlink is not very customisable. For example, I want to link to a file called eulogy.doc but just have the link read Eulogy. I have tried hiding the extension on the file, but once I create the hpyerlink, it overrides my text with the filename Including the extension .doc?! Is anyone else having this problem?
    Thanks all.
    Mel

    Hi, guys. I was looking at your posts and I sort of have a similar problem. When oyu bring your mouse cursor over a link and leave it there for about two seconds without clicking....usually a yellow box will come up showing you the destination of the link. Either that or something will come up on the bottom of your web browser that shows the destination. I was wondering if there's a way to hide that and make it read something else.
    Like if you wanted to make a link to an ip address than a bunch of numbers won't look as attractive as something like, "Hey check this out". Is there a way to change that in iweb? If so how do you do it? i.e. what's the html code, etc. etc. Thanks guys I would appreciate any help.

  • Premiere and Media Encoder CC with Cineform(converted files have static for audio)

    Hi there,
    using Media Encoder CC to convert 7D and 5DMKIII video files to Cineform .avi and all I'm getting at the other end for audio is loud static.  Video is fine but audio is corrupt.  Anyone run into this with CC?  I didn't have this problem before CC.

    Do you have the same problem with other AVI codecs?  What about non-AVI options?

  • ANT task to process properties-files into static class

    Hi,
    I think this problem is very interesting. I have a web application that needs various configuration. I'm using a properties file that is loaded into a Properties-class.
    The problem arrises when runtime exceptions are thrown (NullPointerException) by using:
    String value = props.getProperty("myProp");
    (In this case the entry "myProp" is not available.)
    The solution would be to process the properties file and put all keys and values into a class with public static attributes:
    class Props {
    public static String myProp = "123";
    This processing should be done with ANT! It shall create a JAVA file before the general compilation task. This would be great and runtime exceptions concerning a lack of propertie-keys are extinguished forever.
    Is there any tool for ANT that helps?
    Thanks in advance.

    Personally, I would not like it - I can't compile even parts of my code without running Ant to build the whole thing? Second, I do not want my build tool to alter or add any source files.
    IMO, you should instead simply go and check for null values before using them. I'd regard these NPEs rather as programming flaws - you already pointed out that their value may be null, so not checking is just wrong.
    Lastly, maybe you can create a tool yourself - generating a code like this is highly trivial. you only have to keep in mind that development will be a PITA because an IDE with incremental compile will always fail with compilation errors as long as it doesn't create that constants class Ant's supposed to create.
    Oh, and why not ask Ant-related questions in an Ant forum?

  • Embed .swf file or how to hide your .swf file on the web for protection

    Hi, is it possible to hide your .swf file so that it can not be taken.  Is there a way to protect it?  if someone please post the chain of commands on how to do this.

    http://www.google.co.in/#hl=en&source=hp&q=swf+encryption+software&oq=swf+encryption&aq=2v &aqi=g2g-v8&aql=&gs_sm=e&gs_upl=848l6367l0l9310l22l20l3l2l2l0l324l3334l1.4.7.3l15&bav=on.2 ,or.r_gc.r_pw.&fp=bdf9e41683b1cd0a&biw=1024&bih=609

  • Static used on global variable declaration

    I have inherited a CVI project that contains a single .C file and a couple of .UIR files with their associated .H files.
    Many of the global variables have STATIC in their declaration - I believe this is due to the fact the original developer originally had them inside various functions and at some point changed strategy to make them global, leaving the STATIC keyword in place when copy/pasting.
    As I understand it the ONLY implication of STATIC on a global variable would be to keep its visibility only to the .C file in which it is declared. In this instance that is moot since there is only one .C file in the project.
    Is there anything about LabWindows/CVI which I might not be aware of that makes this use of STATIC cause something different than if STATIC were not used?
    Thanks for any input you might have since I'm new to CVI

    Roberto and menchar said it well:
    "static variables are declared at compile time and survive when their block of code terminates. If declared at function level, their value survives from one call of the function to another, so that they can be used over time to store permanent values locale to the function. If declared at module level, they are common to all functions in the module and are allocated outside the stack so that their values are not lost during program life. In every case they can be accessed and modified in values by functions in the program. If arrays, they cannot be dinamically changed in size."
    "The static keyword can be used with a function name also, meaning the function name isn't exported to the linker, and the function is in scope only to code within the module."

  • Do I need to declare my custom setter accessor in my interface/header file

    Hi there:
    I'm working through a Objective C tutorial. I've got an instance var that is declared in the var section of my @interface (in the header file). It's also declared as a property...all the defaults apply (assign and whatever else).
    @property int foo
    I also have it synthesized in my @implementation code.
    @synthesize foo;
    I need a custom setter though that checks out the value being assigned. Do I need to declare this setter function in my @interface section in the header file?
    -(void)setFoo:(int)newValue {
    if (newValue < minAllowed) {
    NSLog(@"Invalid foo: %i is less than the minimum of %i allowed", newValue, minAllowed);
    return;
    if (newValue > maxAllowed) {
    NSLog(@"Invalid foo: %i is greater than the maximum of %i allowed", newValue, maxAllowed);
    return;
    foo = newValue;
    } // setFoo()

    The @property statement is the declaration of the accessor methods whether they are synthesized or custom coded.
    For a fairly clear, detailed explanation see Accessor Methods in the +Memory Management Programming Guide for Cocoa+.

Maybe you are looking for

  • My new WD hard drive is no longer able to boot. How do I fix this?

    I got a WD10EALX Cabiar Blue drive last week and copied my existing internal drive that had Tiger OSX on it. It booted fine until I copied an iphoto library from a friend's Mac and now this disk won't boot. I get the circle with the slash through it

  • Mapping error : BaseRuntimeException / Fatal

    Hi XI experts, I'm working on a very very simple File to File Scenario SAP XI 3.0 (SP16). When using a simple SAP XI graphical mapping i'd create, i get fatal error : com/sap/xi/tf/_ZEBE_FILE1_TO_INVERT_FILE1_ a com.sap.aii.utilxi.misc.api.BaseRuntim

  • Migration from of database and app from SQL server 2005 to Oracle 10g

    Hello Every body, Lately, I have been requested to migrate one inhouse developed hub application from SQL server 2005 to Oracle 10g. The objective is to move application and also the database to Oracel 10g. Here is the current platform: OS Win 2008 6

  • Reg: PO text

    hi, how to get the relationship between eeko,ekpo and po text table , to display the po text in the output. (po text from: mm03). already developed a report to display the output joining ekko and ekpo. regards chandra

  • Communication between SAP and JMS external server

    Dear all, I have to create a formular Smartform and provide file XML. For that it's ok because the smartform allow it in standard. After I have to send the file XML to server JMS. How to make that ?? I have got a system SAP Netwaever 7.0 ECC 6.0  onl