PDA

View Full Version : How to link to API .lib files?


stuh505
02-25-2005, 11:05 PM
Im trying to use Codewarrior. Ive tried a number of things and tried reading around but havent been able to successfully link to these libraries.

What I've done is added these folders to the "Access Path":

C:\Program Files\Alias\Maya6.0\include
C:\Program Files\Alias\Maya6.0\lib

My code is:


#include <maya/MSimple.h>
#include <maya/MIOStream.h>
DeclareSimpleCommand( helloWorld, "Alias", "6.5");
MStatus helloWorld::doIt( const MArgList& )
{
cout << "Hello World\n";
return MS::kSuccess;
}

When I try to compile, I get this:


Error : declaration syntax error
(included from:
MString.h:49
MSimple.h:43
helloworld.cpp:1)
MTypes.h line 222 typedef unsigned char bool;
Error : identifier expected
(included from:
MString.h:49
MSimple.h:43
helloworld.cpp:1)
MTypes.h line 226 enum {false,true};
Warning : implicit 'int' is no longer supported in C++
(included from:
MString.h:49
MSimple.h:43
helloworld.cpp:1)
MTypes.h line 400 _declspec( dllimport )
Error : declaration syntax error
(included from:
MString.h:49
MSimple.h:43
helloworld.cpp:1)
MTypes.h line 400 _declspec( dllimport )
Error : ';' expected
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 77 class OPENMAYA_EXPORT MStatus
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 78 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 80 public:
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 106 MStatus();
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 108 MStatus( MStatusCode );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 110 MStatus( const MStatus& );
Error : illegal 'operator' declaration
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 113 MStatus& operator=( const MStatus& rhs);
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 115 bool operator==( const MStatus& rhs ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 117 bool operator==( const MStatusCode rhs ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 119 bool operator!=( const MStatus& rhs ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 121 bool operator!=( const MStatusCode rhs ) const;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 123 operator bool() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 125 bool error() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 129 MStatusCode statusCode() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 131 MString errorString() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 133 void perror( const char * ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 135 void perror( const MString& ) const;
Error : illegal 'friend' declaration
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 144 friend OPENMAYA_EXPORT IOS_REF(ostream)& operator<<( IOS_REF(ostream)&, MStatus&);
Error : illegal 'friend' declaration
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 146 friend OPENMAYA_EXPORT inline bool operator==( const MStatus::MStatusCode,
Error : illegal 'friend' declaration
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 149 friend OPENMAYA_EXPORT inline bool operator!=( const MStatus::MStatusCode,
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 153 protected:
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 156 private:
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 160 };
Error : undefined identifier '?8'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 210 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 211 return ( fStatusCode == rhs.fStatusCode );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 212 }
Error : undefined identifier 'MStatusCode'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 214 inline bool MStatus::operator==( const MStatus::MStatusCode rhs ) const
Warning : implicit 'int' is no longer supported in C++
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 215 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 215 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 216 return ( fStatusCode == rhs );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 217 }
Error : undefined identifier '?9'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 220 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 221 return ( fStatusCode != rhs.fStatusCode );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 222 }
Error : undefined identifier 'MStatusCode'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 224 inline bool MStatus::operator!=( const MStatus::MStatusCode rhs ) const
Warning : implicit 'int' is no longer supported in C++
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 225 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 225 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 226 return ( fStatusCode != rhs );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 227 }
Error : undefined identifier '?B_N'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 230 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 231 return fStatus;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 232 }
Error : undefined identifier 'error'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 235 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 236 return !fStatus;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 237 }
Error : undefined identifier 'MStatusCode'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 239 inline MStatus::MStatusCode MStatus::statusCode() const
Warning : implicit 'int' is no longer supported in C++
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 240 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 240 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 241 return ( MStatus::MStatusCode ) fStatusCode;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 242 }
Error : undefined identifier 'set'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 247 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 248 fStatus = status;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 249 fStatusCode = theStatusCode;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 250 fInternalStatusCode = internalStatusCode;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 251 }
Error : undefined identifier 'setSuccess'
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 254 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 255 fStatus = true;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 256 fStatusCode = MS::kSuccess;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 257 fInternalStatusCode = 0xff;
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 258 }
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 260 inline bool operator==( const MStatus::MStatusCode code,
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 261 const MStatus& status )
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 262 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 263 return ( status.fStatusCode == code );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 264 }
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 266 inline bool operator!=( const MStatus::MStatusCode code,
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 267 const MStatus& status )
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 268 {
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 269 return ( status.fStatusCode != code );
Error : declaration syntax error
(included from:
MString.h:50
MSimple.h:43
helloworld.cpp:1)
MStatus.h line 270 }
Error : data object 'dllimport' redefined
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 70 class OPENMAYA_EXPORT MString
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 71 {
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 73 public:
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 75 MString();
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 77 MString( const char* charString );
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 79 MString( const char* charString, int charLength );
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 81 MString( const MString& other );
Error : declaration syntax error
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 83 ~MString();
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 85 MString& operator += ( const MString& other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 87 MString& operator += ( const char * other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 89 MString& operator += ( double other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 91 MString& operator += ( int other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 93 MString& operator += ( unsigned int other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 95 MString& operator += ( float other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 97 MString& operator = ( const MString& other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 99 MString& operator = ( const char * other );
Error : illegal 'operator' declaration
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 101 MString& operator = ( double value );
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 103 bool operator == ( const MString& other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 105 bool operator == ( const char * other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 107 bool operator != ( const MString& other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 109 bool operator != ( const char * other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 111 MString operator + (const MString& other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 113 MString operator + (const char * other ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 115 MString operator + ( double value ) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 125 const char* asChar() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 127 unsigned length() const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 131 int index(char) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 133 int rindex(char) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 135 MStatus split(char, MStringArray&) const;
Error : illegal use of const/volatile function qualifier sequence
(included from:
MSimple.h:43
helloworld.cpp:1)
MString.h line 137 MString substring(int start, int end) const;

westiemad
02-26-2005, 11:49 AM
the problem maybe the software your using to write in, Mayas API only likes Visual C++ .net to compile its plugins, something to do with arguement order i think.

CGTalk Moderation
02-26-2006, 12:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.