i need use some GDI32 functions, but i need add the library 1st. i try link it with linker options, but the text wasn't showed. so how can add the library by code? note: the #pragma comment(lib, "gid32.lib") isn't portable, that's why i can't use it :(
#include <iostream>
#include <string.h>
#include <windows.h>
//#include <WinGdi.h>
using namespace std;
int main()
{
//TextBlink("hello world", 10,20,3,5);
HDC hDC=GetDC(GetConsoleWindow());
SetTextColor(hDC,6);
TextOut(hDC,1,5,"hello world",strlen("hello world"));
cin.get();
}