I am tying to use some .Net namespaces in my c++ code. From here I have found, how can I do that. In my code I have:
#include <iostream>
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace Microsoft::Sqlserver::Server;
using namespace System::Data::SqlTypes;
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
If I run it I get these errors:
0:08:06: Running steps for project Test...
10:08:06: Configuration unchanged, skipping qmake step.
10:08:06: Starting: "/usr/bin/make"
g++ -c -m64 -pipe -g -Wall -W -DQT_WEBKIT -I/usr/share/qt4/mkspecs/linux-g++-64 -I../Test -I../Test -I. -o main.o ../Test/main.cpp
../Test/main.cpp:2:17: error: 'System' is not a namespace-name
../Test/main.cpp:2:23: error: expected namespace-name before ';' token
../Test/main.cpp:3:17: error: 'System' has not been declared
../Test/main.cpp:3:25: error: 'Data' is not a namespace-name
../Test/main.cpp:3:29: error: expected namespace-name before ';' token
../Test/main.cpp:4:17: error: 'System' has not been declared
../Test/main.cpp:4:31: error: 'Sql' is not a namespace-name
../Test/main.cpp:4:34: error: expected namespace-name before ';' token
../Test/main.cpp:5:17: error: 'Microsoft' has not been declared
../Test/main.cpp:5:39: error: 'Server' is not a namespace-name
../Test/main.cpp:5:45: error: expected namespace-name before ';' token
../Test/main.cpp:6:17: error: 'System' has not been declared
../Test/main.cpp:6:31: error: 'SqlTypes' is not a namespace-name
../Test/main.cpp:6:39: error: expected namespace-name before ';' token
make: *** [main.o] Error 1
10:08:06: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Test (kit: Desktop)
When executing step 'Make'
10:08:06: Elapsed time: 00:00.
what should I do to solve this problem? By the way, I have read this and this posts, but I could not understand, what should I do with /clr in my cpp code?