Compiler error with default arguments and static template function

Hi 
The following does not compile with visual studio 2010 sp1, and compiles with gcc.
#include <string>
class A
public:
   template<class T>
   static T& Get(const std::wstring&);
class B
 public:
  void f(
    double d,
    double c =A::Get<double>(L"test"));
int main()
    B b;
    b.f(5);
It gives me the following error 
error C2783: 'T & A::Get(const wchar_t *)' : could not deduce template argument for 'T'
If I change Get to be global function and not static function of A, it compiles.

It seems to be a compiler bug.  It fails in VS2012, but compiles in VS2013.
For completion sake, the problem exists if A is a namespace containing Get.  But not if Get is global.
The only solutions I can see are try to workaround the problem (make Get global) or upgrade to a newer version of VS.

Similar Messages

  • Compiler Errors With Class Definitions and Clients

    Hi there, I need help with some code, here it is.
    import java.util.*;
    import java.text.*;
    public class InvestCalc {
         //declaration of instance variables
         private double interest, principal;
         //default constructor, sets interest and principal to zero
         public InvestCalc() {
              interest = 0.0;
              principal = 0.0;
         //overloaded constructor
         public InvestCalc( double startInterest, double startPrincipal) {
              interest = startInterest;
              principal = startPrincipal;
         //accessor methods for instance variables
         public double getRate() {
              return interest;
         public double getPrincipal() {
              return principal;
         //mutator methods
         public void setRate(double newInterest) {
              interest = newInterest;
         public void setPrincipal(double newPrincipal) {
              principal = newPrincipal;
         //String toString() method
         public String toString() {
              return "Interest Rate: " + percent.format(interest) + ", Principal: " + DOLLAR_FORMAT.format(principal);     
         //futureValue(int year) method
         public double futureValue(int year) {
              double futureValue = Math.pow((1 + interest), year)*principal;
              return futureValue;
         //public static final class variables
         public static final int shortTerm = 5;
         public static final int middleTerm = 10;
         public static final int longTerm = 20;
         //public void display Table() method
         public void displayTable() {
              System.out.println("Year" + "\t" + "Interest Rate" + "\t\t" + "Principal" + "\t\t" + "Future Value");
              System.out.println(shortTerm + "\t" + percent.format(interest) + "\t\t\t" + DOLLAR_FORMAT.format(principal) + "\t\t" + DOLLAR_FORMAT.format(futureValue(shortTerm)));
              System.out.println(middleTerm + "\t" + percent.format(interest) + "\t\t\t" + DOLLAR_FORMAT.format(principal) + "\t\t" + DOLLAR_FORMAT.format(futureValue(middleTerm)));
              System.out.println(longTerm + "\t" + percent.format(interest) + "\t\t\t" + DOLLAR_FORMAT.format(principal) + "\t\t" + DOLLAR_FORMAT.format(futureValue(longTerm)));
         //formatting section
         public static final NumberFormat DOLLAR_FORMAT = NumberFormat.getCurrencyInstance();
         public static final DecimalFormat percent = new DecimalFormat("##0.00%");
    import java.util.*;
    public class InvestCalcApp {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              //declare Scanner class and interest, principal vars
              Scanner input = new Scanner(System.in);          
              double interest, principal;     //vars for the interest rate and initial investment
              //instantiate a default object of the InvestCalc class
              InvestCalc value1 = new InvestCalc();
              System.out.println("Default InvestCalc Object");
              System.out.println(value1.toString()+ "\n");
              //query for interest and principal
              System.out.print("Enter an interest rate in decimal format: ");
              interest = input.nextDouble();
              System.out.print("Enter the initial investment value: ");
              principal = input.nextDouble();
              //change object and output
              value1.setRate(interest);
              value1.setPrincipal(principal);
              System.out.println("Updated InvestCalc Object");
              System.out.println(value1.toString());
              //test the futureValue method and the DOLLAR_FORMAT static class variable
              System.out.println("Value after 1 year " + InvestCalc.DOLLAR_FORMAT.format(value1.futureValue(1)) + "\n");     
              value1.displayTable();     
              //query for another interest and principal
              System.out.print("Enter another interest rate in decimal format: ");
              interest = input.nextDouble();
              System.out.print("Enter another initial investment value: ");
              principal = input.nextDouble();
              //instantiate an object of the InvestCalc class
              InvestCalc value2 = new InvestCalc(interest, principal);
              System.out.println("Non-Default InvestCalc Object");
              System.out.println(value2.toString()+ "\n");
              value2.displayTable();
    }When I compile InvestCalc.java it compiles; however, when I compile InvestCalcApp.java I receive 5 errors:
    InvestCalcApp.java:15: cannot find symbol
    symbol : class InvestCalc
    location: class InvestCalcApp
                     InvestCalc value1 = new InvestCalc();
    InvestCalcApp.java:15: cannot find symbol
    symbol : class InvestCalc
    location: class InvestCalcApp
                     InvestCalc value1 = new InvestCalc();
    InvestCalcApp.java:32: package InvestCalc does not exist
                                  System.out.println("Value after 1 year " + InvestCalc.DOLLAR_FORMAT.format(value1.futureValue(1)) + "\n");
    InvestCalcApp.java:42: cannot find symbol
    symbol : class InvestCalc
    location: class InvestCalcApp
                     InvestCalc value2 = new InvestCalc(interest, principal);
    InvestCalcApp.java:42: cannot find symbol
    symbol : class InvestCalc
    location: class InvestCalcApp
                     InvestCalc value2 = new InvestCalc(interest, principal);Sorry if that's a lot of reading, but I need help, I'm new at this and not quite sure what those errors mean. Thanks

    The errors mean the compiler can not find the InvestCalc class. The compiler looks for classes using the Classpath. It might work if you use a command likejavac -cp . InvestCalcApp.javaThis command tells javac to look in the current directory for dependent classes.

  • Compilation errors with JDeveloper 10.1.2.2.0

    Hello,
    I want to change my environment work. First I worked with Eclipse (Europa, jre 1.6), I have no error with my following code source :
    private List<String> lString;
    and now I have a compilation error with the same code
    ' Error(43,14): <identifier> expected '
    I think it's a compiler version problem but I'm not sure and I don't know how to change the compiler version.
    If someone have any idea, I will be happy to receive response.
    Thanks

    JDeveloper 10.1.2.2.0 doesn't support neither JDK 1.6 nor JDK 1.5.
    --olaf                                                                                                                                                                                       

  • I am unable to burn any info-photo ect on to a disk. I have a 27" I mac mid 2010 version. I put in a disk, hit burn, it runs for about 3 mins and ejects the disk sayiny there was an error with the drive and will not restart.

    am unable to burn any info-photo ect on to a disk. I have a 27" I mac mid 2010 version. I put in a disk, hit burn, it runs for about 3 mins and ejects the disk sayiny there was an error with the drive and will not restart.

    The optical drive has probably failed. It's a fairly common thing with these slim SuperDrives. Does it read any discs you put into it? You can try resetting the SMC and pram but I'll be surprised if it helps.
    To reset the SMC
    Shut down the computer.
    Unplug the computer's power cord.
    Wait fifteen seconds.
    Attach the computer's power cord.
    Wait five seconds, then press the power button to turn on
    Resetting PRAM and NVRAM
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • I was downloading the software update for ipod touch 2gen and after it was done downloading it showed that there was an error with my ipod and when i saw it was on the lockscreen loading. its been like this for 4 hours already

    I was downloading the software update for ipod touch 2gen and after it was done downloading it showed that there was an error with my ipod and when i saw it was on the lockscreen loading. its been like this for 4 hours already

    What did the error message say?
    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar

  • E-Recruiting: Problems with search profile and serach templates

    Hi Recruiting-Experts,
    I´m facing problems with "Search Profiles" and "Search Templates"
    (Customizing SPRO --> SAP-E-Recruiting --> Recruitment --> Talent Warehouse --> Candidate --> Candidate Search )
    Out customers wants me to add a new search criterion to the talent search. It's a customer-field (type 'd' --> Date)  belonging to infotype 5106.
    Unfortunately, it doesn't work. The hit list is always empty.
    What I did:
    Customizing (see above)
    Updated search profile (report RCF_RECREATE_SEARCH_PROFILES)
    The result:
    I can see and choose the new search criterion on talent warehouse search site (recruiters startpage)
    I can find the data (internal format yyyymmdd) via transaction SKPR07 (see XML below, ZZEARLIEST_ENTRY 20090901)
    By the way, the hit list is also empty when adding and searching for birthdate.
    Has it got to do with the date stored in internal format?
    Thanks for any comments / help.
    Regards
    CHRIS
    =========================================================================

    Hi Sebastian,
    thanks for your quick answer.
    That's why I didn't get it done for hours yesterday.
    Thanks again,
    Regards
    CHRIS

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • Compile errors with Solaris 5.8 and Studio 11 with latest patches

    I asked sa to patch my studio 11, and they applied patches 121023-04, 121015-04, 121017-08, 122142-03, 120761-03, 120760-11 and 122135-02. Then, I compiled my boost_1_33_1 again. It built some, but not all libraries. It stil spit out the following errors. Is this expected?
    "/home/vcheng/boost_1_33_1/libs/filesystem/build/../src/operations_posix_windows.cpp", line 126: Error: readdir_r is not a member of file level.
    ...failed sunpro-C++-action build_sunos/bin/boost/libs/filesystem/build/libboost_filesystem.a/sunpro/debug/operations_posix_windows.o...
    sunpro-C++-action build_sunos/bin/boost/libs/wave/build/libboost_wave.a/sunpro/debug/instantiate_cpp_exprgrammar.o
    "/home/vcheng/boost_1_33_1/boost/spirit/core/composite/epsilon.hpp", line 76: Error: complex expression not allowed in dependent template argument expression.
    "/home/vcheng/boost_1_33_1/boost/iostreams/device/file_descriptor.hpp", line 79: Warning: close_on_exit hides boost::iostreams::file_descriptor::impl::close_on_exit.
    1 Warning(s) detected.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 42: Error: BZ_CONFIG_ERROR is not defined.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 106: Error: The function "BZ2_bzCompressEnd" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 107: Error: The function "BZ2_bzDecompressEnd" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 113: Error: The function "BZ2_bzCompress" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 118: Error: The function "BZ2_bzDecompress" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 143: Error: The function "BZ2_bzCompressInit" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/iostreams/build/../src/bzip2.cpp", line 147: Error: The function "BZ2_bzDecompressInit" must have a prototype.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 97: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 100: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 110: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 349: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 383: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 437: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 458: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 477: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/cmdline.cpp", line 495: Warning: args hides boost::program_options::detail::cmdline::args.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/config_file.cpp", line 35: Warning: allowed_options hides boost::program_options::detail::common_config_file_iterator::allowed_options.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 311: Error: Could not find a match for std::count<std::InputIterator, std::T, std::Size>(char*, char*, char) needed in::format_paragraph(std::ostream &, std::string, unsigned, unsigned).
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Error: Too few arguments for template std::reverse_iterator.
    "/.automount/opt/Forte/sunstudio11_patch1/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 432: Error: "friend" declaration is incompatible with function template.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Where: While specializing "std::reverse_iterator<const char*>".
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 378: Where: Specialized in non-template code.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 379: Error: Too few arguments for template std::reverse_iterator.
    "/home/vcheng/boost_1_33_1/libs/program_options/build/../src/options_description.cpp", line 387: Error: Could not find a match for std::distance<std::ForwardIterator, std::Distance>(const char*, const char*) needed in::format_paragraph(std::ostream &, std::string, unsigned, unsigned).

    You can take Boost 1.34 but you have to use CVS and you have to modify Boost configuration files to use -library=stlport4 option.
    Or you can take Boost 1.32, read this article http://blogs.sun.com/roller/page/sga?entry=boost_mini_howto and apply this patch http://blogs.sun.com/roller/resources/sga/boost_1_32_0.patch.
    As you can see here http://engineering.meta-comm.com/boost-regression/CVS-RC_1_34_0/developer/summary.html Sun C++ is in a good shape.

  • Compilation errors with boost 1.36

    Hi,
    My compiler
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-08 2002/06/02
    I am getting the followin*g errors when trying to compile
    Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 108: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 116: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 122: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 128: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 141: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    "./boost/math/tools/precision.hpp", line 172: Error: Default arguments cannot be added in later declarations of the template function in the same scope.
    I have done configuration as following
    %> ./configure with-toolset=sun prefix=/u/jn/boost/boost_1_36_0
    my usr-config.jam file looks as below
    # Boost.Build Configuration
    # Automatically generated by Boost configure
    # Compiler configuration
    using sun : 6 : /home/nfs/sollocal/beatlehome1/F6U2/SUNWspro/bin/CC : <stdlib>sun-stlport
    <cxxflags>-library=stlport4 -m64 -xcode=pic32 -erroff=wvarhidemem,hidevf,hidevfinvb -errtag
    s=yes <linkflags>-library=stlport4 -m64 ;
    # Python configuration
    using python : 2.6 : /usr/local ;
    my Makefile
    BJAM=./tools/jam/src/bin.solaris/bjam
    BJAM_CONFIG= -sICU_PATH=/usr
    prefix=/u/jnarayan/boost/boost_1_36_0
    exec_prefix=$(prefix)
    libdir=$(exec_prefix)/lib
    includedir=$(prefix)/include
    LIBS=
    all: .dummy
    @echo "$(BJAM) $(BJAM_CONFIG) --user-config=user-config.jam $(LIBS)"
    @$(BJAM) $(BJAM_CONFIG) --user-config=user-config.jam $(LIBS) || \
    echo "Not all Boost libraries built properly."
    clean: .dummy
    rm -rf bin.v2
    distclean: clean
    rm -rf Makefile config.log
    check: .dummy
    @cd status && ../$(BJAM) $(BJAM_CONFIG) --user-config=../user-config.jam || echo "S
    ome Boost regression tests failed. This is normal for many compilers."
    install: .dummy
    @echo "$(BJAM) $(BJAM_CONFIG) address-model=64 user-config=user-config.jam pref
    ix=$(prefix) exec-prefix=$(exec_prefix) libdir=$(libdir) --includedir=$(includedir) $(L
    IBS) install"
    @$(BJAM) $(BJAM_CONFIG) address-model=64 --user-config=user-config.jam --prefix=$(p
    refix) --exec-prefix=$(exec_prefix) --libdir=$(libdir) --includedir=$(includedir) $(LIBS) i
    nstall || echo "Not all Boost libraries built properly."
    .dummy:
    thanks in advance for your help

    BOOST cannot be compiled with WS6u2.
    The oldest compiler that can build BOOST is Sun Studio 11 (C++ 5.8).
    You will have better luck with Sun Studio 12 (C++ 5.9). Both Studio 11 and Studio 12 are free.
    Get Sun Studio 12 here:
    [http://developers.sun.com/sunstudio/]
    Sun Studio 12 requires Solaris 9, 10, or Open Solaris.
    If you are running Solaris 8, get Sun Studio 11 instead:
    [http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
    After installing the appropriate version of Sun Studio, get all current patches for it here:
    [http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
    Then check Simon's blog for advice on building BOOST with Sun Studio 11 or 12.
    [http://blogs.sun.com/sga/category/Boost]

  • Compiling errors with modified SALOME module PKGBUILDS from AUR

    Good day,
    I am in the process of installing SALOME (6.4.0), a pre- and post-processor for differential equation solvers (FEM in my case).
    The source code is distributed as a single tar.gz file and inside one finds source directories for the various modules used.
    In AUR is available a set of old, outdated modules of SALOME 5.1.4 (here)
    So far, I have successfully compiled and installed the salome-kernel package by modifying the PKGBUILD to find the source locally on my computer. Apart from changing some version variables, all I needed to change was to add
    PYTHON=/usr/bin/python2
    to ./configure, since it looks for /usr/bin/python by default and this causes issues (I'm not sure why python2 and python3 exists, actually).
    I then proceeded to salome-med. I managed all of its non-salome dependencies and am now stuck on salome-gui which is also a dependency. I followed the same procedure, this time specifying both python and opencascade paths. ./configure seems to finish with no problems (a summary is shown and all deps are present) and after a bit of compiling it stops with the following errors:
    Plot2d.h:49:11: error: field 'text' has incomplete type
    Plot2d.h:51:78: error: invalid use of incomplete type 'struct QString'
    /usr/include/QtCore/qglobal.h:1525:7: error: forward declaration of 'struct QString'
    Plot2d.h:88:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:91:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:94:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:97:73: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:101:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:104:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:107:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:110:66: error: default argument for 'const QColor& <anonymous>' has type 'Qt::GlobalColor'
    Plot2d.h:112:3: error: 'QPixmap' does not name a type
    Plot2d.h:115:3: error: 'QPixmap' does not name a type
    Plot2d.cxx: In constructor 'Plot2d_Point:lot2d_Point(double, double, const QString&':
    Plot2d.cxx:50:27: error: class 'Plot2d_Point' does not have any field named 'text'
    Plot2d.cxx: At global scope:
    Plot2d.cxx:388:92: error: 'QPixmap Plot2d::markerIcon(const QSize&, const QColor&, Plot2d::MarkerType)' should have been declared inside 'Plot2d'
    Plot2d.cxx:406:90: error: 'QPixmap Plot2d::lineIcon(const QSize&, const QColor&, Plot2d::LineType)' should have been declared inside 'Plot2d'
    Plot2d.cxx: In function 'bool Plot2d::existMarker(int, const QwtPlot*, QwtSymbol::Style, const QColor&, Qt:enStyle)':
    Plot2d.cxx:461:44: error: request for member 'style' in 'crv->QwtPlotCurve::symbol()', which is of non-class type 'const QwtSymbol*'
    make[2]: *** [libPlot2d_la-Plot2d.lo] Error 1
    make[2]: Leaving directory `/home/stefan/builds/salome-med/salome-med/DEPMAKER_DEPS/salome-gui/src/GUI_SRC_6.4.0/src/Plot2d'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/stefan/builds/salome-med/salome-med/DEPMAKER_DEPS/salome-gui/src/GUI_SRC_6.4.0/src'
    make: *** [all-recursive] Error 1
    I'm not sure what most of this means, since I know basically nothing about Qt (which seems to be the problem). I've read somewhere of someone having had problems with previous versions of salome using qwt 4 commands while the affected user had qwt 5, which made me suspect that maybe some Qt syntax changed since salome 6.4 was released. The documentation says that it was tested with Qt 4.6 and qwt 5.1. I have:
    Qt = 4.8
    pyqt = 4.9
    qwt = 6.01
    I attempted to look at some of the lines in the problem files but due to my lack of knowledge couldn't figure out anything. I do not suspect anyone here knows everything about SALOME but maybe someone who knows about Qt and the likes recognises what's wrong. The files showing errors are here:
    http://docs.salome-platform.org/salome_ … 2d_8h.html
    http://docs.salome-platform.org/salome_ … ource.html
    http://docs.salome-platform.org/salome_ … _8cxx.html
    http://docs.salome-platform.org/salome_ … files.html
    I'm using a 32bit processor, if it's relevant.
    I'll gladly and quickly supply any extra info.
    Thank you in anticipation,
    A.L.
    Last edited by ArseneLupin (2012-02-15 22:05:51)

    If the main app uses RSLs, the modules should not.  Use -static-rsls and
    extern the RSL classes.

  • Compilation error with RWTValDlist T find() method

    This code used to compile fine with SC 4.x C++ compiler. We are migrating to "Sun WorkShop 6 update 2 C++ 5.3 2001/05/15" and it is now generating the following compilation error:
    ===============================
    cd generic/src; make -f generic.mk
    /opt/SUNWspro/bin/CC -c -PIC -compat -library=rwtools7 -O2 -I. -I. -I../include -I/home/jm/sunos5.8/ib_service_3.4.3/include -I/opt/local/megen/include -I/opt/SUNWspro/WS6U2/include/CC -I../../interface/include -I../include -I. -I/home/jm/sunos5.8/acell_4.1/include -I/opt/local/access/home/include -I/home/jm/sunos5.8/acell_4.1/include/packetcpp -I/home/jm/sunos5.8/acell_4.1/include/ecl -I/home/jm/sunos5.8/acell_4.1/include/gels -I/home/jm/sunos5.8/acell_4.1/src/security/include -I/home/jm/sunos5.8/acell_4.1/include/sequencer -I/home/jm/sunos5.8/acell_4.1/include/gen -I/home/jm/sunos5.8/acell_4.1/include/recipeMgr -I/home/jm/sunos5.8/acell_4.1/include/EFEFeature -I/home/jm/sunos5.8/ib_service_3.4.3/include -I/opt/local/megen/include -I/opt/local/rv/include -I/opt/local/etk/include -I/opt/local/etk/include/tdl -DTCPIP=1 -D__SYSVR4 -DSHOP=1 -D_SOLARIS=1 -I/opt/local/std_comp/include ACEAlarmClock.C
    "ACEAlarmClock.C", line 479: Error: Could not find a match for RWTValDlist<ACEObject*>::find(int(const ACEObject*&,void*), void**, ACEObject*).
    1 Error(s) detected.
    *** Error code 1
    make: Fatal error: Command failed for target `ACEAlarmClock.o'
    ===============================
    The header file in question is:
    #include <rw/tvdlist.h>
    class ACEAlarmClock : public ACEObject
    // The public interface.
    public:
    ACEAlarmClock();
    // Default constructor.
    private:
    static void alarmCallback(void *passAheadRef, ib_alarmid alarmId);
    static RWTValDlist<ACEObject *> AlarmClocks;
    and the source file in question is:
    void
    ACEAlarmClock::alarmCallback(void *passAheadRef, ib_alarmid alarmId)
    ACEObject *object = 0;                        // returned by find()
    if (AlarmClocks.find(findAlarmId, &alarmId, object))
    ACEAlarmClock alarmClock = (ACEAlarmClock )object;
    if (alarmClock)
    AlarmClocks.remove(alarmClock);
    alarmClock->isActive_ = FALSE;
    alarmClock->onAlarm(passAheadRef, alarmId);
    return;
    Any help is highly appreciated. Thanks.
    Cesar Saavedra
    [email protected]

    The C++ Migration Guide that comes with the compiler explains in detail everything you to need to know about migrating from C++ 4.2 to C++ 5.3.
    Use the "-compat" option on every CC command, compiling and linking. Any code that worked with C++ 4.2 will work the same way with C++ 5.3 in compat mode.
    -compat=4 sets language and binary compatibility to that of the 4.x compilers. -compat=5 sets language and binary compatibility to ANSI/ISO standard mode. If the -compat option is not specified, -compat=5 is assumed.
    - Rose

  • Compile Error with self-increment of Short

    Migrated to a new IDE (eclipse) and using the same jdk settings. The statement adds two Short variables using += operator. For example,
    Short a = 10;
    Short b = 20;
    a += b;
    It did not give error in the prior IDE but the current one shows "The operator += is undefined for the argument type(s) Short, short" error. Do you think the jdk version used in the build path is different.
    Thanks,
    Edited by: EJP on 20/07/2012 14:26L edited your title to something meaningful. Don't use meaningless titles, they just minimize your chance of getting a useful answer.

    Do you want to use short primitives or the Short wrapper class?
    This compiles fine:
    public class ShortTest {
        public static void main(String[] args) {
            short a = 10;
            short b = 20;
            a += b;
            System.out.println("a="+a+",b="+b);
    C:\>javac ShortTest.java
    C:\>java ShortTest
    a=30,b=20This does not:
    public class ShortTest {
        public static void main(String[] args) {
            Short a = 10;
            Short b = 20;
            a += b;
            System.out.println("a="+a+",b="+b);
    C:\>javac ShortTest.java
    ShortTest.java:5: error: inconvertible types
            a += b;
                 ^
      required: Short
      found:    int
    1 error

  • Compiler bug in 10.1.3 EA1?  get "Internal compilation error" with EnumSet

    The code sample below generates "Error: Internal compilation error, terminated with a fatal exception" when doing make. It's a very simple example, it creates an EnumSet with one element and dumps it via the "toString()" method.
    If I change the line:
    "EnumSet set = EnumSet.of(Buttons.ONE);"
    To:
    "EnumSet set = EnumSet.allOf(c);"
    It works fine. For some reason the "of" method of "EnumSet" crashes the compiler.
    Any ideas?
    ========================================
    package mypackage;
    import java.util.EnumSet;
    public class EnumDemo
    enum Buttons { ONE, TWO, THREE }
    public EnumDemo()
    public void dump()
              Class c = Buttons.class;
              EnumSet set = EnumSet.of(Buttons.ONE);
              System.out.println(set.toString());
    public static void main(String[] args)
    EnumDemo cls = new EnumDemo();
    cls.dump();
    ==============================

    package com.esp.main;
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TreeNavigator extends JTree {
    private FormMain fm;
    public TreeNavigatorNode selectedTreeNode;
    public TreePath selectedTreePath;
    public JTree thisTree;
    public TreeNavigator(FormMain pFM) {
    fm = pFM;
    thisTree = this;
    addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent e) {
    selectedTreeNode = (TreeNavigatorNode)thisTree.getLastSelectedPathComponent();
    if (selectedTreeNode == null) {
    return;
    selectedTreePath = e.getPath();
    addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    if (e.getClickCount() == 1) {
    doPopup(e.getX(), e.getY());
    String nodeInternalFrameClassName = selectedTreeNode.getInternalFrameClassName();
    String nodeNodeTypeDesc = selectedTreeNode.getNodeTypeDesc();
    if ((selectedTreeNode != null) && (nodeNodeTypeDesc.equals("FORM") || nodeNodeTypeDesc.equals("GRAPH"))) {
    fm.showInternalFrame(nodeInternalFrameClassName, fm, null);
    } else if (e.getClickCount() == 1) {
    TreePath path = thisTree.getClosestPathForLocation(e.getX(), e.getY());
    thisTree.setSelectionPath(path);
    public void doPopup(int x, int y) {
    if ((selectedTreeNode != null) && selectedTreeNode.nodeTypeDesc.equals("MODULE")) {
    fm.cm.sendString("Do Nothing");
    } else {
    fm.cm.sendString("Launch form");
    setEditable(false);
    setMaximumSize(new java.awt.Dimension(3200, 3200));
    setPreferredSize(new java.awt.Dimension(800, 100));
    setShowsRootHandles(false);
    setLargeModel(false);
    setRootVisible(false);
    setDragEnabled(false);
    DefaultTreeModel treeNavigatorModel = new DefaultTreeModel(fm.treeNavigatorNodeArray[fm.rootNode], true);
    treeModel.addTreeModelListener(new NavigatorTreeModelListener());
    setModel(treeNavigatorModel);
    expandAll(this);
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    public void expandAll(JTree tree) {
    int row = 0;
    while (row < tree.getRowCount()) {
    tree.expandRow(row);
    row++;
    private void jbInit() throws Exception {
    this.setSize(new Dimension(286, 383));
    TreeNavigatorCellRenderer renderer = new TreeNavigatorCellRenderer(fm);
    this.setCellRenderer(renderer);
    class NavigatorTreeModelListener implements TreeModelListener {
    public void treeNodesChanged(TreeModelEvent e) {
    TreeNavigatorNode node;
    node = (TreeNavigatorNode)(e.getTreePath().getLastPathComponent());
    * If the event lists children, then the changed
    * node is the child of the node we've already
    * gotten. Otherwise, the changed node and the
    * specified node are the same.
    try {
    int index = e.getChildIndices()[0];
    node = (TreeNavigatorNode)(node.getChildAt(index));
    } catch (NullPointerException exc) {
    public void treeNodesInserted(TreeModelEvent e) {
    public void treeNodesRemoved(TreeModelEvent e) {
    public void treeStructureChanged(TreeModelEvent e) {
    }

  • Compilation error with (amp) restriction specifier in C++ AMP

    Hi,
    [double post from :
    original post ]
    I'm using C++ AMP (I'm not that experienced with C++ and I'm new to AMP, so I have to stumble through this stuff) But I thought I had this code working, but now I'm getting the following error:
    Error    1    error C3930: 'WRC_Raytracer::RaytracerRTC::RenderSceneWithAMP::<lambda_c13eb21eb34534d03d408733745bcf16>::operator ()' : no overloaded function has restriction specifiers that are compatible with the ambient
    context 'Concurrency::_Parallel_for_impl'
    Here is my parallel loop (cut down slightly to focus on the issue):
    [code]
        parallel_for(0, 720 * 576, 1, [w, cBuffer, pixelDataView](int i) restrict(amp)
                    // compute x and y for the given index
                    float x = (float)(i % w);
                    float y = (float)(i / w);
                    // convert color from {0,1}f to {0,255}b
                    int bInt, gInt, rInt;
                    bInt = (int) (min(x/719.f, 1) * 255);
                    gInt = (int) (min(y/575.f, 1) * 255);
                    rInt = (int) (min(0, 1) * 255);
                    // represent color data as (int)argb
                    int pixelAsInt = (255 << 24) + (rInt << 16) + (gInt << 8) + bInt;
                    // update pixelData element
                    pixelDataView[i] = pixelAsInt;
    [/code]              
    Can anyone see what's wrong here ? As I said, I'm sure this was working yesterday, and I did something just before shutting down, and now it's not working.
    Edit : I tried the parallel_for_each loop that I had started with. And that actually does work ...
    parallel_for_each(pixelDataView.extent,[=](index<1> idx) restrict(amp)

    Hello Gavin, thank you for your question.
    Note that parallel_for_each (more precisely, the overloads that accept extent arguments and take a restrict(amp) functional parameter) is the unique entry-point for C++ AMP execution. Other functions in the concurrency namespace, such as parallel_for,
    are unrelated, and stem from a different technology (PPL). Since restrict(amp) is specific to C++ AMP, trying to use a restrict(amp) functional object in any context but that of C++ AMP execution, is not possible - hence the compiler error
    you were seeing. Hopefully this turns out helpful for you. Also, congratulations for picking up C++ AMP, I hope you like it! Cheers!

  • BUG: 10.1.3..36.73 Internal Compile Error with enhanced for loop/generics

    I get the following compiler error when using the Java 5 SE enhanced for loop with a generic collection.
    Code:
    public static void main(String[] args)
    List<Integer> l = new ArrayList<Integer>();
    l.add(new Integer(1));
    printCollection(l);
    private static void printCollection(Collection<?> c)
    for (Object e : c)
    System.out.println(e);
    Error on attempting to build:
    "Error: Internal compilation error, terminated with a fatal exception"
    And the following from ojcInternalError.log:
    java.lang.NullPointerException
         at oracle.ojc.compiler.EnhancedForStatement.resolveAndCheck(Statement.java:2204)
         at oracle.ojc.compiler.StatementList.resolveAndCheck(Statement.java:4476)
         at oracle.ojc.compiler.MethodSymbol.resolveMethod(Symbol.java:10822)
         at oracle.ojc.compiler.RawClassSymbol.resolveMethodBodies(Symbol.java:6648)
         at oracle.ojc.compiler.Parser.resolveMethodBodies(Parser.java:8316)
         at oracle.ojc.compiler.Parser.parse(Parser.java:7823)
         at oracle.ojc.compiler.Compiler.main_internal(Compiler.java:978)
         at oracle.ojc.compiler.Compiler.main(Compiler.java:745)
         at oracle.jdeveloper.compiler.Ojc.translate(Ojc.java:1486)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildGraph(UnifiedBuildSystem.java:300)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildProjectFiles(UnifiedBuildSystem.java:515)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.buildAll(UnifiedBuildSystem.java:715)
         at oracle.jdeveloper.compiler.UnifiedBuildSystem$CompileThread.run(UnifiedBuildSystem.java:893)

    Install the Service Update 1 patch for JDeveloper (using the help->check for updates), and let us know if this didn't solve the problem.

Maybe you are looking for

  • IMac won't print to Dell B1160W

    I have just bought a new Dell B1160W. My sisters iMac (identical to mine but she has an earlier OS X) can print fine, but whenever I try to print - it says "Printing - Printer is ready to print", the printer wakes up, but then an error message - "Pri

  • Problem- Adobe Media Encoder Stopping Mid Queue

    I was exporting my final movie, which was about 60 minutes. It was taking a long time to render when exporting to a quicktime file, which I expected, however, the Adobe Media Encoder stopped the rendering an hour later, only rendering half before shu

  • Can't get sound in QuickTime - please help

    Hi I purchased the Quicktime pro and downloaded codecs from perian first - I tried playing an .avi file movie and got no sound. Then I downloaded codecs from DivX player site - and still no sound - video is fine. I have sound using other formats and

  • Alias name for Oracle E-Business Suite URL on R12.1.3

    Hello Friends Please advise on this below requests We are on Fresh install of R12.1.3 and we are able to accessing Oracle Apps Front page using url " *http://server20.apps.org:8010*" Is it possible to create a Alias name to this url like http://tests

  • Unknown drives popping up

    I've recently started having an error dialogue box pop up when I select my alias to open Bridge. I saids that it can not find the application because it has either been renamed or moved. But when I click OK Bridge is operational. I didn't anything of