Click here to Skip to main content
13,199,026 members (44,763 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to gprof my program. I want a line-by-line profiling.
However, I can't seem to get the syntax write. I am using "make" and not "gcc" so please help only with suggestions that fit make. I wouldbe very grateful if you can give me the full "make" syntax.
Based on this website:[^][^]
Here is what I am inputting:
make USE_LOCAL_HEADERS=0 LDFLAGS='-L.' BASE_CFLAGS=-m32 CFLAGS='-fopenmp -pg -l -g'
The output is:
/usr/bin/ld: cannot find -l-g
collect2: ld returned 1 exit status
make[2]: *** [build/release-linux-ppc64/ioquake3.ppc64] Error 1
make[2]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean'
make: *** [release] Error 2

I need option "-l", "-g" and "-pg".

Linux noob
Posted 17-Nov-11 19:16pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The '-l' option is not valid for gcc so it assumes that it, and all following options, should be passed to the linker. You need to check which options are valid for gprof, as described here[^], and for gcc as described here[^].
Shakti Misra 18-Nov-11 12:56pm
I agree with Richard. Let us know if you get some problem with it.
coffeenet 20-Nov-11 22:58pm
"make USE_LOCAL_HEADERS=0 LDFLAGS='-L. -pg' BASE_CFLAGS=-m32 CFLAGS='-fopenmp -pg -g'" is how it got operative now. So, as you kindly said, "-l" was not valid. Thank you for the help.
Richard MacCutchan 21-Nov-11 8:15am
You're welcome. Please mark this answer as accepted so others will know your problem is resolved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 18 Nov 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100