Drupal Get User ID

In Drupal the logged in user is stored as a global variable. Following code can access the logged in user ID

And in profile page, you can use $user variable directly

 

PySide message box

When you want to display a warning message (like "File doesn't exist") to user, using message box is a good choice. Following code is how to create a message box in PySide:

QMessageBox is the message window class, it's defined in PySide.QtGui module. setText method will set the information text, and exec_ method will display the message box and waiting for user's operation.

Undefined symbols for architecture i386: _htmlReadMemory

SOAPEngine is an iOS SOAP client library, the trial version provides a .framework file for user.

I added it via Project->Targets->General->Linked Frameworks and Libraries, then include its header file:

But when compiling the program, I got following error message:

Undefined symbols for architecture i386:
"_htmlReadMemory", referenced from:
_PerformHTMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlFreeDoc", referenced from:
_PerformHTMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
_PerformXMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlReadMemory", referenced from:
_PerformXMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlXPathEvalExpression", referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlXPathFreeContext", referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlXPathFreeObject", referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
"_xmlXPathNewContext", referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Actually libxml2 is needed for SOAPEngine, so we need add "libxml2.dylib" file to "Linked Frameworks and Libraries". After adding this library, the error disappeared.