Question: I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:

```
#define TitleLabelId 1000;

//....

hTitleText = CreateWindow(L"STATIC",
                          L"Test Text",
                          WS_VISIBLE | WS_CHILD,
                          0, 0,
                          300, 20,
                          hWnd,
                          (HMENU)TitleLabelId,
                          hInst,
                          NULL);

```

This gives me an compile error, while this will give me a correct result:

```
HMENU hm = (HMENU)TitleLabelId;

hTitleText = CreateWindow(L"STATIC",
                          L"Test Text",
                          WS_VISIBLE | WS_CHILD,
                          0, 0,
                          300, 20,
                          hWnd,
                          (HMENU)TitleLabelId,
                          hInst,
                          NULL);

```

I tried to outsource the Label Text aswell but unfortunateley it didnt work either using the following directive:

```
#define TitleText L"Blob Color War";

```

Is it anything with the syntax I have overseen? Thanks in advance!

Answer: 
Looks like problem with your metastore. If you are using the default hive metastore embedded derby. Lock file would be there in case of abnormal exit. if you remove that lock file this issue would be solved  

```
rm   metastore_db/*.lck

```
I was facing the same issue there are some important point's that could be resolve this problem.

**1.Put the following at the beginning of hive-site.xml**

```
  <property>
    <name>system:java.io.tmpdir</name>
    <value>/tmp/hive/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby:,databaseName=$HIVE_HOME/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore </description>
  </property>

```

this is set relative path in absolute URI and configuring Metastore where the database is stored

**2.Remove `$HIVE_HOME/metastore_db` But Be aware, this will remove your schema completely!**

**3.Now,You must Initialize Derby database.By default, Hive uses Derby database**

> 
> $HIVE\_HOME/bin/schematool -initSchema -dbType derby
> 
> 
> 

also I suppose that your environment variable has been set correctly ,if not please check them that are looking like below:

```
export HADOOP_HOME=/usr/local/hadoop 
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HIVE_HOME=/usr/lib/hive
export PATH=$PATH:$HIVE_HOME/bin

```

and then run `hive` command and type `show databases;`