01-09-2008
Application link error with gcov
Hi,
I'm trying gcov on my Debian VM.
gcov (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
It work with example program, but I got link error in my application code.
C_FLAGS += -Wall -W -O0 -fprofile-arcs -ftest-coverage
Each class file has the same error:
fileMgr.o: In function `global constructors keyed to 0__ZN7FileMgrC2Ev':
fileMgr.cpp: (.text+0x254da): undefined reference to `__gcov_init'
fileMgr.o: (.data.rel+0x24): undefined reference to `__gcov_merge_add'
backupMgr.o: In function `global constructors keyed to 0__ZN9BackupMgrC2Ev':
backupMgr.cpp: (.text+0x10458): undefined reference to `__gcov_init'
backupMgr.o: (.data.rel+0x24): undefined reference to `__gcov_merge_add'
...
collect2: ld returned 1 exit status
make: *** [fileMgmt] Error 1
Did I missing something?
Thanks!
10 More Discussions You Might Find Interesting
1. Programming
Hi,
After I installed gcc on my machine and issued a command to compile a program, I did
gcc -c 'prog'.c
The object file was created, then I did
gcc -o 'prog' 'prog'.o
Then I got this error message I have been reading man pages and searching the internet but have not been able to... (1 Reply)
Discussion started by: rachael
1 Replies
2. Linux
Dear linuxers,
I'm a novice in C++ programming.
I wrote a ReadFile class in file ReadFile.cpp.
After that, I wrote a test.cpp, which contains a main function, to test whether my class work well.
I follow the following steps to compile the ReadFile.cpp file.
g++296 -c ReadFile.cpp -o... (4 Replies)
Discussion started by: niukun
4 Replies
3. Linux
Hi,
I am working on gcov.Meaning, analysing the functionality of gcov. There is one structure called "struct bb". I am not sure, how struct bb members are getting assigned values. If anyone knows how it is happening pls let me know.
Thanks in advance.
--Vichu (0 Replies)
Discussion started by: Vichu
0 Replies
4. Shell Programming and Scripting
Hey.
GCC GCOV now outputs a file called sysmacros.h as part of its results.
How can I remove it from the html?
The tags looks like this:
<tr bgcolor="e0f0d0">
<td bgcolor="dae7fe" style="padding-top: 3px; padding-left: 30px; padding-bottom: 3px; padding-right: 30px;">... (3 Replies)
Discussion started by: rpowell86
3 Replies
5. Programming
Hi,
I am using gcov to get code coverage for my program written in C++, I am able to do it without any problem when i don't have a directory structure, for my program I am a directory structure as below
./src/ -- containing all my source files
./obj/ -- containing all my object... (0 Replies)
Discussion started by: niranjanvg
0 Replies
6. Shell Programming and Scripting
Hi,
I have the following gcov compilation flags in all the QT source code project (*.pro) files.
CONFIG(gcov) {
LIBS += -lgcov
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
}
Now, I want to remove these flags off my files. Please help me with a script to... (1 Reply)
Discussion started by: royalibrahim
1 Replies
7. Programming
Hello All,
I've encountered a strange behaviour from g++ that doesn't make sense to me. Maybe you can shed some light on it:
I have a bunch of source files and want to compile them and link them with a static library liba.a located in /usr/local/lib64 into an executable
Approach 1 works... (0 Replies)
Discussion started by: magelord
0 Replies
8. UNIX for Dummies Questions & Answers
Hi everybody,
I read about treads realted to this issue but they did not resovle issue given below.
Please help me resolve issue given below
I have html file under /srv/www/htdocs/actual_folder
ls actual_folder/
test.html
and following link works... (0 Replies)
Discussion started by: newbielgn
0 Replies
9. Solaris
Hi All
I am facing an issue with our new solaris machine.
in /var/adm/messages
root@Prod-App1:/var/tmp#
root@Prod-App1:/var/tmp#
root@Prod-App1:/var/tmp# cat /var/adm//messages
Apr 20 03:10:01 Prod-App1 syslogd: line 25: WARNING: loghost could not be resolved
Apr 20 08:24:18 Prod-App1... (0 Replies)
Discussion started by: javeedkaleem
0 Replies
10. Solaris
Hi All
I am facing an issue with our new solaris machine.
in /var/adm/messages
Apr 22 16:43:05 Prod-App1 in.routed: interface net0 to 172.16.101.1 turned off
Apr 22 16:43:33 Prod-App1 mac: NOTICE: nxge0 link up, 1000 Mbps, full duplex
Apr 22 16:43:34 Prod-App1 mac: NOTICE: nxge0 link... (2 Replies)
Discussion started by: javeedkaleem
2 Replies
LEARN ABOUT DEBIAN
gcov2perl
GCOV2PERL(1p) User Contributed Perl Documentation GCOV2PERL(1p)
NAME
gcov2perl - convert gcov files to Devel::Cover databases
VERSION
version 0.89
SYNOPSIS
gcov2perl -h -i -v -db database gcov_files
DESCRIPTION
Convert gcov files to Devel::Cover databases.
OPTIONS
The following command line options are supported:
-db database - specify the database to use
-h -help - show help
-i -info - show documentation
-v -version - show version
DETAILS
To obtain coverage of XS files they must first be compiled with the appropriate options. In a standard Makefile environment, such as that
created by ExtUtils::MakeMaker, this can be accomplished with the command:
HARNESS_PERL_SWITCHES=-MDevel::Cover make test
CCFLAGS=-O0 -fprofile-arcs -ftest-coverage
OTHERLDFLAGS=-fprofile-arcs -ftest-coverage
If you have already built your object files it may be necessary to run make clean first, or to find some other way to ensure that they get
rebuilt with the options gcov requires.
Now the code coverage data has been collected "gcov" needs to be run:
gcov Mylib.xs
This will create one or more gcov files on which you can run "gcov2perl":
gcov2perl Mylib.xs.gcov
Finally, "cover" should be run as usual with any options required:
cover
If you are running everything with standard options, you can do all this with one command:
cover -test
EXIT STATUS
The following exit values are returned:
0 All files converted successfully
>0 An error occurred.
SEE ALSO
Devel::Cover
BUGS
Huh?
LICENCE
Copyright 2001-2012, Paul Johnson (paul@pjcj.net)
This software is free. It is licensed under the same terms as Perl itself.
The latest version of this software should be available from my homepage: http://www.pjcj.net
perl v5.14.2 2012-06-15 GCOV2PERL(1p)