bouviervj / libprofiler

Realtime profiler for C/C++ applications
GNU General Public License v2.0
5 stars 0 forks source link

Complie errors #1

Closed ghost closed 10 years ago

ghost commented 10 years ago

Trying to compile generated project:

[1/2] Building CXX object CMakeFiles/profiler.dir/libprofiler.cpp.o
FAILED: /usr/bin/clang++   -Dprofiler_EXPORTS -fPIC  -fPIC -MMD -MT CMakeFiles/profiler.dir/libprofiler.cpp.o -MF "CMakeFiles/profiler.dir/libprofiler.cpp.o.d" -o CMakeFiles/profiler.dir/libprofiler.cpp.o -c ../libprofiler.cpp
../libprofiler.cpp:81:2: warning: control may reach end of non-void function [-Wreturn-type]
        }
        ^
../libprofiler.cpp:94:2: warning: control may reach end of non-void function [-Wreturn-type]
        }
        ^
../libprofiler.cpp:122:2: warning: control may reach end of non-void function [-Wreturn-type]
        }
        ^
../libprofiler.cpp:134:2: warning: control may reach end of non-void function [-Wreturn-type]
        }
        ^
../libprofiler.cpp:811:38: warning: 'calls' has C-linkage specified, but returns incomplete type 'std::vector<ITEM_METHOD *>' which could be incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::vector<ITEM_METHOD*> calls(THREAD_CONTEXT* iCtxt ,char *iFuncName){
                                     ^
../libprofiler.cpp:846:38: warning: 'returnMethodCalls' has C-linkage specified, but returns user-defined type 'std::vector<ITEM_CALLER *>' which is incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::vector<ITEM_CALLER*> returnMethodCalls(THREAD_CONTEXT* iCtxt ,char *iFuncName){
                                     ^
../libprofiler.cpp:872:24: warning: 'string_format' has C-linkage specified, but returns user-defined type 'std::string' (aka 'basic_string<char>') which is incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::string string_format(const std::string fmt, ...) {
                       ^
../libprofiler.cpp:893:24: warning: 'timeDisplay' has C-linkage specified, but returns user-defined type 'std::string' (aka 'basic_string<char>') which is incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::string timeDisplay(long long iTime){
                       ^
../libprofiler.cpp:928:38: warning: 'findPrimaryCallers' has C-linkage specified, but returns user-defined type 'std::vector<ITEM_CALLER *>' which is incompatible with C [-Wreturn-type-c-linkage]
extern "C" std::vector<ITEM_CALLER*> findPrimaryCallers(THREAD_CONTEXT* iCtxt){
                                     ^
../libprofiler.cpp:1094:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
../libprofiler.cpp:1335:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
../libprofiler.cpp:1382:26: error: no viable overloaded '='
        _hdlErrorStruct.sa_mask = 0;
        ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/usr/include/bits/sigset.h:27:9: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const __sigset_t' for 1st argument
typedef struct
        ^
../libprofiler.cpp:1393:25: error: no viable overloaded '='
        _hdlTermStruct.sa_mask = 0;
        ~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/usr/include/bits/sigset.h:27:9: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const __sigset_t' for 1st argument
typedef struct
        ^
11 warnings and 2 errors generated.
bouviervj commented 10 years ago

I have never tried to compile it with clang, you should try with gcc if you consider it's an acceptable option. I never tested also the lib with programs compiled with clang. I mean, as it need to be compiled with gcc option -finstrument-functions.

Cheers, Julien

bouviervj commented 10 years ago

If you're interested in seeing a more precise description you can have a look to that : http://jbvsblog.blogspot.com/2013/10/realtime-cc-profiler.html