Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Using STL with CodeWarrior

    SDK Help
    0
    3
    347
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 28/03/2003 at 07:02, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      I'm using CodeWarrior under Windows to build a plugin for a Mac target, and having problems using STL.

      If I don't use the STL (Standard Template Library) then it compiles cleanly. My code doesn't need the math library functions (sin(), cos(), etc) but if I use them it still compiles cleanly, so the compiler is finding the maths header/library.

      If I add the line:

      #include <vector>

      to the top of the file prior to the 'c4d.h' include, then I get compiler errors saying that cos() and sin(), etc cannot be found. This applies even if I'm not using those functions.

      If I move the above include statement to after the 'c4d.h' include, I get a different error stating that 'offsetof' is being redefined.

      I note that the STL is not used at all in the SDK examples (which compile cleanly).

      So, there seems to be some nasty interaction between the '#include <vector>' and the '#include "c4d.h"', which means that I can't use the STL. This behaviour isn't limited to the vector container, either.

      Any comments, suggestions, etc?

      Cheers - Steve

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 28/03/2003 at 10:30, xxxxxxxx wrote:

        This is how I do it:

            
            
            // xlentstl.h:  
              
            #ifndef XLENT_STL_H  
            #define XLENT_STL_H
            
            
            
            
            #undef offsetof  
            #include <vector>  
            #include <set>  
            #include <algorithm>
            
            
            
            
            #endif
            
             
            
              
              
              
            // myalgorithm.cpp  
              
            #include "c4d.h"  
            #include "c4d_symbols.h"  
            #include "xlentstl.h"  
              
            void Function(BaseContainer& bc)  
            {  
             using namespace std;  
              
             vector<String> list;  
            }
        

        This compiled fine in CW8.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 28/03/2003 at 11:30, xxxxxxxx wrote:

          Aha! Yes, that works - thanks!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post