머리말 최근 4차 산업혁명 시대를 맞아 가상현실, 인공지능 등 소프트웨어 개발과 관련한 직업에 대한 관심이 높아지고 있습니다. 그런데 안타깝게도 이런 분야의 직업을 가지길 희망하거나 관련 학문에 갓 입문한 분들이 수학이라는 벽에 부딪혀서 좌절하는 경우를 주변에서…
Tag: programming
template <class T> // or template <typename T> class A { public: A() {} ~A() {} void aaa() { std::list<T> aList; … std::list<T>::iterator itr =…
#define LIFESPAN 0x000002 bool hasLifespan( int attrBitMask ) { return ( attrBitMask & LIFESPAN ); } 위와 같은 code가 있다고 했을 때, 다음과 같은 경고(warning)이 발생할 수 있다. warning C4800: ‘int’ : ‘true’ 또는 ‘false’로 bool…
#include <Process.h> int main( int argc, char** argv ) { system( "ls" ); return 0; } 이러한 방식으로 system() 함수를 이용하여 외부 프로그램을 실행할 수 있다. 하지만, system 함수는 실행 결과의 상태를 알려주는 int 값을…
class A { public: int &x; int y; A(): x(y), y(0) {}; }; int main( int argc, char** argv ) { A a; cout << a.x << endl; cout << a.y << endl; cout <<…
class A { public: int data[2]; int &x, &y; A(): x(data[0]), y(data[1]) {} A( int xx, int yy ): x(data[0]), y(data[1]) { x=xx; y=yy; } }; int main( int argc,…
void aaa( char* str ) { … } 일 때, aaa( “abcdefg” ); 라고 실행하면 발생하는 에러이다. 두 가지의 해결방법이 있다. 첫 번째, void aaa( const char* str ) { … } 와 같이 수정한다….
class A { public: int a, b; A(): b(0), a(0) {} }; 만약 위와 같은 code를 사용했을 때, gcc에서 다음과 같은 warning이 발생할 수 있다. warning: ‘A::a’ will be initialized after warning:…
“undefined refernce to…” 이러한 error는 source code에서 어떤 외부 library를 사용하지만 해당 library가 link되어 있지 않아서 code 내용을 가져올 수 없기 때문에 발생하는 error이다. 여기서는 libz를 찾지 못해서 발생하는 compile error이므로, Makefile에 -lz 를 추가해주면…
class A { public: float x; A(): x(0) {} }; std::vector av; A a; av.push_back( a ); 했을 때, can’t use default assignment operator 와 같은 error가 발생한다면, class A 에 다음…
Visual Studio에서 다음과 같은 compile error가 발생할 때가 있다. UTL error C2872: ‘ostream’ : ambiguous symbol 이럴 때에는 C/C++ -> Preprocesser -> Preprocessor Definations에 REQUIRE_IOSTREAM를 추가해주면 된다.
다음과 같은 error가 발생할 때, C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(122) : warning C4005: ‘CALLBACK’ : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\GL/glut.h(34) : see previous definition of ‘CALLBACK’ #include <windows.h>를 #include <glud.h>…
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(406) : error C2381: ‘exit’ : redefinition; __declspec(noreturn) differs C:\Program Files\Microsoft Visual Studio 8\VC\include\GL/glut.h(146) : see declaration of ‘exit’ \sourceCode\main.cpp(362) : error C3861: ‘exit’: identifier not found 이러한 에러 발생시 해결법…
[Test environment] CentOS 5.4 Maya 2011 x64 [Test Code (mel)] polySphere; select -r pSphere1.map[0]; int $i = 0; for( ; $i<100000; ++$i ) { polyEditUV -u 0.5 -v 0.5; } [Problem] maya를 종료할 때까지…
I developed my own smoke simulator and rendered the data using Maya, but met a problem. MFnFluid fluidFn( fDagPath ); unsigned int Nx, Ny, Nz; fluidFn.getResolution( Nx, Ny, Nz ); float* density = fluidFn.density(); for( int…
Maya에서 addattr로 dynamic attribute를 compound 형식으로 만들고 나서, deleteattr로 지운 뒤, 다시 같은 이름의 dynamic attribute를 addattr로 생성하면 다음과 같은 error가 발생하며 실패하게 된다. Too many children on this compound. Method 1 After deleting the dynamic…
MItMeshPolygon::getArea does not work in World Space. The Object Space area is always returned. Workaround Use MItMeshPolygon::getTriangles to get the triangles in World Space; then calculate the areas of the triangles and sum them
[bad usage] particle -q -attribute position -order 7; // Error: No object matches name: position // [good usage] particle -attribute position -order 7 -q particleShape1; // Result: 5 0 0 //
Very simple maya command plug-in code. #include #include #include #include class test : public MPxCommand { public: virtual MStatus doIt ( const MArgList& ); static void* creator() { return new test; } }; MStatus initializePlugin( MObject obj…