Ok as you know I work in the MS Visual C++ environment.
I'm working with a folder named
simple inside ARToolKit. All the files related to GTK+ and Glade are in a folder name as
Interface. This
Interface folder contains the primary folders
msvc,
src and more. In folder
msvc there is a
config.h file. In folder
src there is
callbacks.c,
main.c,
interface.c,
support.c and so on.
In my main program (i.e. in folder
simple) known as
simpleTest.c, I am making a call so that an interface window can appear.
Below is an extract of
simpleTest.c (showing the differents headers involved).
Code:
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#ifndef __APPLE__
#include <GL/gl.h>
#include <GL/glut.h>
#else
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#endif
#include <AR/gsub.h>
#include <AR/video.h>
#include <AR/param.h>
#include <AR/ar.h>
#include <gtk/gtk.h>
#include "interface/src/callbacks.h"
#include "interface/src/support.h"
#include "interface/src/interface.h"
As you've noticed I added the part:
Code:
#include <gtk/gtk.h>
#include "interface/src/callbacks.h"
#include "interface/src/support.h"
#include "interface/src/interface.h"
Since, there is a
main block in
simpleTest.c, I had to modify
main.c (in src folder) so that it has no
main block. I just did it like that:
Code:
int
mainn (int argc, char *argv[])
{
............
/* main changed to mainn */
............
GtkWidget *win_main;
........................................
........................................
win_main = create_win_main ();
gtk_widget_show (win_main);
g_signal_connect ((gpointer) win_main, "destroy", G_CALLBACK(gtk_main_quit),
NULL);
}
#ifdef _MSC_VER
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return mainn (__argc, __argv);
}
#endif
Ok, now in the
main block of
simpleTest.c, I am trying to call win_main. Don't know if it's the right way, but it does compile well.
Code:
int main(int argc, char **argv)
{
GtkWidget *win_main;
win_main = create_win_main ();
gtk_widget_show (win_main);
...............................
...............................
}
Ok now I think you understand my problem better.
I tried to comment the following lines in
main.c, but getting one error when compiling.
Code:
gchar *package_prefix = PACKAGE_PREFIX;
gchar *package_data_dir = PACKAGE_DATA_DIR;
gchar *package_locale_dir = PACKAGE_LOCALE_DIR;
The error is:
Code:
c:\...\simple\interface\src\main.c(54) : error C2065: 'PACKAGE' : undeclared identifier
This is obvious due to the line 54:
Code:
pixmap_dir = g_build_filename (package_data_dir, PACKAGE, "pixmaps", NULL);
I tried to declare PACKAGE as:
Code:
char *PACKAGE=""
But then 78 errors pop up :(
I even tried the following (on recommendation of some friends):
Code:
gchar *package_prefix = "";
gchar *package_data_dir = "";
gchar *package_locale_dir = "";
But getting the same one error as above:
Code:
c:\...\simple\interface\src\main.c(54) : error C2065: 'PACKAGE' : undeclared identifier
Hope someone could help me solving this.
Many thanks.