My first Makefile - HELP!!
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > My first Makefile - HELP!!




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    My first Makefile - HELP!!  
jamiil


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-14-07 06:14 PM

There are two thing I would like to address to here:
1.) In this LInux box I have two accounts; root and myaccount, when I
type:
$ pkg-config gtkmm-2.4 --cflags

I get the following message:

Package gtkmm-2.4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkmm-2.4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkmm-2.4' found

How can I change that?


2.) I wrote this simple Makefile, which by the way is my first
Makefile, it is a test Makefile to make sure that everyting works. The
helloworld.??p and the main.cpp are copy/pasted from the manual's
book. So, I would say that they can be trusted.
And here is copy of my Makefile.jme

# Makefile
# Pogrammer:
# Date:
# Version:
# Description:

# Variables
#~~~~~~~~~~
# Compiler name
CPP=g++

# Executable
EXEC=Jaime

# Flagas
CFLAGS= -Wall -ggdb3
##-O3 --param=ggc-min-expand

#Libraries
GTKmm_LIBS=`pkg-config gtkmm-2.4 --cflags --libs`

#Local Variables
OBJS = main.o helloworld.o

#Application name
my_app: $(OBJS)
$(CPP) $(LDLIBS) $(OBJS) -o $(EXEC)  $(GTKmm_LIBS)

main.o: main.cpp
$(CPP) $(CFLAGS) -c main.cpp

helloworld.o: helloworld.hpp
$(CPP) $(CFLAGS) -c helloworld.cpp

# Remove the following files
clean:
rm -f $(OBJS)
rm -f $(EXEC)
rm -f *.*~

PHONY: clean


This is the error I get:g++ -Wall -ggdb3  -c main.cpp
main.cpp:1:24: gtkmm/main.h: No such file or directory
In file included from main.cpp:2:
helloworld.hpp:4:26: gtkmm/button.h: No such file or directory
helloworld.hpp:5:26: gtkmm/window.h: No such file or directory
In file included from main.cpp:2:
helloworld.hpp:7: error: `Gtk' is not a class or namespace
helloworld.hpp:8: error: `Window' is not a class or namespace
helloworld.hpp:8: error: invalid base-class specification
helloworld.hpp:19: error: syntax error before `::' token
main.cpp: In function `int main(int, char**)':
main.cpp:6: error: `Gtk' undeclared (first use this function)
main.cpp:6: error: (Each undeclared identifier is reported only once
for each
function it appears in.)
main.cpp:6: error: parse error before `::' token
main.cpp:9: error: parse error before `::' token
main.cpp:12:2: warning: no newline at end of file
make: *** [main.o] Error 1

What am I doing wrong?

T.I.A.






[ Post a follow-up to this message ]



    Re: My first Makefile - HELP!!  
s. keeling


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-07 06:14 AM

jamiil <jalqadir@gmail.com>:
>  There are two [things] I would like to [address here]:
>  1.) In this LInux box I have two accounts; root and myaccount, when I

What Linux?  Distro and version please.  Helps us help you.  :-)

>  type:
>  $ pkg-config gtkmm-2.4 --cflags

Are you running Slackware or one of its derivatives (ie., Zenwalk)?
Where did gtkmm-2.4 come from?  How did you get it?  What did you do
with it once you got it?

>  I get the following message:
>
>  Package gtkmm-2.4 was not found in the pkg-config search path.
>  Perhaps you should add the directory containing `gtkmm-2.4.pc'

Where is gtkmm-2.4.pc?

find / -type f -name 'gtkmm-2.4.pc' -print

is the brute force method.  Alternatively, if updatedb has been run
recently, "locate gtkmm-2.4.pc" might find it for you.

>  2.) I wrote this simple Makefile, which by the way is my first
>  Makefile, it is a test Makefile to make sure that everyting works. The
>  helloworld.??p and the main.cpp are copy/pasted from the manual's

I see "helloworld.??p" here.  What's that?  I assume we've a charset
collision; not your fault (I think) and pretty common these days
(drat).

>  book. So, I would say that they can be trusted.

We cannot trust your typing, sorry:

>  # Makefile
>  # Pogrammer:

# Programmer:

>  helloworld.o: helloworld.hpp

What is an ".hpp" file?

>  main.cpp:1:24: gtkmm/main.h: No such file or directory

Where's gtkmm/main.h?

>  In file included from main.cpp:2:
>  helloworld.hpp:4:26: gtkmm/button.h: No such file or directory
>  helloworld.hpp:5:26: gtkmm/window.h: No such file or directory

Ditto.

>  In file included from main.cpp:2:
>  helloworld.hpp:7: error: `Gtk' is not a class or namespace

Looks to me like you're missing the part where you tell the compiler
which libraries to link with.

>  helloworld.hpp:8: error: `Window' is not a class or namespace
>  helloworld.hpp:8: error: invalid base-class specification

Ditto.

>  helloworld.hpp:19: error: syntax error before `::' token

Another typo?

>  main.cpp:12:2: warning: no newline at end of file

Trivial warning.  Add a blank line at the end of main.cpp to eliminate
it.

>  make: *** [main.o] Error 1
>
>  What am I doing wrong?

I'd say you're right on track for a newbie (no offense meant).  Just
keep banging your head on that wall (google, man pages, re-read your
book), and it'll eventually fall over.  We've all been there, myself
included.

Other things you might explain:

- How did you get here?  What's the book you're reading?

- What are you really trying to do, and with what?  What is gtkmm?
Where'd you get it (if you got it), and in what form was it
received (.rpm, .deb, .tgz, .tar.gz, ...)?  Why is it involved in
your "helloworld" example proggie?

- Consider testing something even simpler than helloworld.C++ - try
helloworld.c:

#include <stdio.h>
#include <stdlib.h>

int main( int argc, char *argv[] ) {

printf( "Hello World.\n" );

exit( EXIT_SUCCESS );
}

Then:

"gcc -o helloworld helloworld.c -Wall"

(just to ensure crucial underlying bits are there and functional).

Have fun.


--
Any technology distinguishable from magic is insufficiently advanced.
(*)    http://www.spots.ab.ca/~keeling          Linux Counter #80292
- -    http://www.faqs.org/rfcs/rfc1855.html    Please, don't Cc: me.
Spammers! http://www.spots.ab.ca/~keeling/emails.html





[ Post a follow-up to this message ]



    Re: My first Makefile - HELP!!  
Mumia W.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-07 12:13 PM

On 03/14/2007 12:26 PM, jamiil wrote:
> There are two thing I would like to address to here:
> 1.) In this LInux box I have two accounts; root and myaccount, when I
> type:
> $ pkg-config gtkmm-2.4 --cflags
>
> I get the following message:
>
> Package gtkmm-2.4 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `gtkmm-2.4.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'gtkmm-2.4' found
>
> How can I change that?
> [...]

Probably you need to install libgtkmm-2.4-dev (the development libraries
for developing C programs that link to libgtkmm-2.4).

I'm assuming you're using Debian/Sarge.






[ Post a follow-up to this message ]



    Re: My first Makefile - HELP!!  
Rodney


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-07 06:15 PM

On Thu, 15 Mar 2007 01:37:12 +0000, s. keeling wrote:

[snip]

$.02

Just to be supportive jamil, there is a lot of good advice in s. keeling's
email. Some of it is obvious and some is 'between the lines'.

Most helpful posters like to see what effort you've already put into a
problem before they spend much effort trying to write out what can turn
out to be complicated answers. My guess would be that Dan C, for example,
would like your current question better than the way you previously asked
your questions.

I will mention one of my own tweaks, whenever I see 'help' (especially
capitalised with exclamation points), I think newbie. That often
translates into someone who is very difficult to help and I know some
people ignore those. In the present case, "My First Makefile" as a subject
says it all, you wouldn't be here if you weren't seeking help. But, you've
been getting good help here and have only run into a little impatience.

Rodney





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:31 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register