[Mono-dev] Building Profiler Example

Greg Young gregoryyoung1 at gmail.com
Tue Jan 20 14:18:39 UTC 2015


Was trying to build the profiler example in the source tree it
mentions to build with

gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
--libs mono`

I am guessing I also need a -I /mymono/includes/mono-2.0

I am still getting build errors though.

 ~/Code/profiletest  gcc -shared -o mono-profiler-sample.so profile.c
`pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
profile.c:19:9: warning: implicit declaration of function 'g_print' is
invalid in C99 [-Wimplicit-function-declaration]
        g_print ("total number of calls: %d\n", prof->ncalls);
        ^
profile.c:39:16: warning: implicit declaration of function 'g_new0' is
invalid in C99 [-Wimplicit-function-declaration]
        prof = g_new0 (MonoProfiler, 1);
               ^
profile.c:39:24: error: unexpected type name 'MonoProfiler': expected expression
        prof = g_new0 (MonoProfiler, 1);
                       ^
2 warnings and 1 error generated.

What am I missing to get this to build?

-- 
Studying for the Turing test


More information about the Mono-devel-list mailing list