Programming :: Compile And Build Program Using A Makefile Template?
Jul 8, 2011
I am new to the whole concept of makefiles, and I'm trying to compile and build my program using a makefile template I have found. My project consists of three directories: "source", where my .cpp files are (source1.cpp, source2.cpp, source3.cpp), "include", where my .h files are (header1.h, header2.h, header3.h), and "obj", where the object files are to be stored (obj1.o, obj2.o, obj3.o). In the project root directory is my makefile, which is as follows:
Code:
EXEC = myexe
CC = g++
IDIR = include
SDIR = source
ODIR = obj
[Code]..
View 4 Replies
ADVERTISEMENT
Mar 4, 2010
I've been trying to work out a way to stop chunks of code being compiled using a variable in my makefile but can't work it out. What I mean is for example in my code I might have.
/****output comms portdata********/
printf("
debug comms port %d",ReadPort("ttys1);
I only wish this code to be compiled when I'm debugging. What I've tried is using #ifdef with
#ifdef COMM_PORT_DEBUG
printf("
debug comms port %d",ReadPort("ttys1);
#endif
Then in my make file I set COMM_PORT_DEBUG to 1 so
DEBUG_DEFS = COMM_PORT_DEBUG=1
I then thought I could put it into my in my link line
all: $(CC) $(CPFLAGS) $(DEBUG_DEFS) $(INC_PATHS) $(SOURCE) -o $(PROGRAM) $(LIB_DIRS) $(GAME_LIBS)
but this gives a
gcc: COMM_PORT_DEBUG=1: No such file or directory
is there a way to do this sort of thing? Or am I barking up the wrong tree?
View 1 Replies
View Related
Apr 17, 2011
I want to build an object code for ARM at91rm9200 board from a Makefile using a crosscompiler.
View 4 Replies
View Related
Feb 12, 2011
im trying to build a simple program for my C programming class, this is the source code
#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;
[Code]...
i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?
View 5 Replies
View Related
Jan 19, 2011
I'm trying to build a spi program using c++. I'm able to perform half-duplex transfers using the read/write functions, it works perfectly. Now I need to perform a full-duplex transfer, but I'm facing some problems. When I try to receive more than one byte, the slave returns to me only one byte.Ex: I send: FF FF FF FF FF The slave must return: 03 02 00 13 04 But what is happening is:
1st Transfer:
tx: FF FF FF FF FF
rx: 03 00 00 00 00
2nd Transfer:
tx: FF FF FF FF FF
rx: 02 00 00 00 00
[code].....
View 3 Replies
View Related
Dec 26, 2010
My Fedora 14 have installed gcc-4.5.1-4.fc14.x86_64,qt-4.7.1-5.fc14.x86_64,
I don't know how to use g++ to compile QT program.
Do I need to set PATH or something else?
View 5 Replies
View Related
Apr 14, 2011
my build machine is x86 machine that is running ubuntu10.04, my target machine is tegra2 that is running on Andrioid, I wish my program can run under shell of android, as first step , I wrote a simplest assembly program which does nothing, but I got a link error, can somebody help me?
View 4 Replies
View Related
Apr 21, 2010
i am not able to compile my test program which uses gtkmozembed.As i am very new to this, i dont know which are the packages to be installed and how to compile
[Code]...
View 1 Replies
View Related
Feb 10, 2010
I have a c program and its related libraries for Linux. But, I need a EXE file to run in windows.
please let me know how to compile the program for windows
View 8 Replies
View Related
May 26, 2010
I am using the C++ compiler G++ to compile my programs on Linux Mint 8 - Gnome.
I recently installed QT and when I tried to compile a simple "Hello World!" program it gave me this error:
Quote:
This is the code in HelloWorldQt.cpp:
Code:
I have tried using GTK instead but I get a similar error.
View 7 Replies
View Related
Feb 26, 2010
I want to capture the ip packets, so i installed
I am getting the following errors.
View 7 Replies
View Related
May 21, 2011
I write a small program to learn overflow. But when I input more than 5 characters (exceed the boundaries of the buffer),I can't get the character that I have initialized. I used gcc4.5.2 to compile this program. Then I used gdb to debug it. I found that when I input more than 5 characters, the variable 'test' was set to 0(ASCII code or '00').
[Code]...
View 8 Replies
View Related
Nov 15, 2010
I wanted to compile a program for my openwrt router from source i already have but to add an option. I ran ./autogen.sh in the terminal but it returned aclocal not found.
View 5 Replies
View Related
Dec 28, 2010
If i have a python file with a function call_me(a,b),how can I call this function from the command line ,after i compile the program?
View 5 Replies
View Related
Sep 20, 2009
I've been trying to figure out how to use make and makefile to compile and link some .cpp/.h. All i seem to find on google says to read the README for the software. But this is my own created c++ project. Im just looking for a simple makefile for my own .cpp/.h files( about 20 total).
I have tried using 2 different makefile "examples" as a template, but neither worked. I am getting error saying "file1.cpp: no newline character at end of file". or something to that degree.
View 5 Replies
View Related
Jun 1, 2011
How to compile single file in Linux environment using gcc. Now i dont know how to use make file to compile multiple file.
View 5 Replies
View Related
Apr 3, 2011
I have C++ source code(*.cpp) files that expects it's header files in System's include folder which is/usr/include.The cpp files has include lines like this:
Code:
#include <some.h>
#include <another.h>
[code]...
View 3 Replies
View Related
May 1, 2011
I have made two source files named as sum.c and average.cI have included sum.c in average.c
both files in Documents directory.when i compile average.ot followingerror"average.c:4:22: fatal error: sum.c: No such file or directorycompilation terminated.How to solve this issue?I have tried to copy sum.c to usrinclude folder but unable to copy
View 8 Replies
View Related
Mar 1, 2011
As part of an assignment, our class was given a small set of c++ classes which are compiled using a makefile. As part of the assignment, I have created a namespace and saved in it a .cpp file. The functions, constants and typedefs from the namespace are now used in one of the original files, and so I added an <#include MyFile.cpp> to the file I modified, in addition to a using MyNamespace;
When I try to use the original makefile, the compiler gives a lot of errors about multiple definitions of every function in the namespace. What do I need to do to resolve this? Do I need to change the makefile or one of the files themselves? I am new to Linux programming and makesfiles.
View 2 Replies
View Related
Apr 6, 2010
So I've been trying to get GIMP 2.7 installed on my Slackware64 13.0, but I'm having some issues. After some extensive finagling and dependence findings, I got it to configure correctly, however, the make fails with libtool trying to find libgdk_pixbuf-2.0.la:
libtool: link: cannot find the library '..//usr/lib64/pkgconfig/gdk-pixbuf/libgdk_pixbuf-2.0.la' or unhandled argument '..//usr/lib64/pkgconfig/gdk-pixbuf/libgdk_pixbuf-2.0.la'
libgdk_pixbuf-2.0.la is in /usr/lib64/pkgconfig/, but for whatever reason, editing the makefile doesn't change this. (Yes I have the right permissions to edit it). First of all, why is it searching for /usr in the top build directory, and second, why doesn't an edit of the makefile work?
View 6 Replies
View Related
Jun 3, 2010
I'm calling a function defined in "uart.c" from "main.c"
But on "make" using cygwin bash, it's giving an error:"Unreferenced function"...
Pls help me to overcome this problem.
If i'm putting the definition of that function in "main.c" itself, its working.
So pls tell me how to write the make file for it?
View 4 Replies
View Related
Mar 6, 2010
Ubuntu 9.10 64-bit
Lenovo T400
I'm trying to install gopenvpn from source. [URL] I'm pretty sure I have all the necessary libraries installed.
./configure ends with:
.
.
.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pixmaps/Makefile
config.status: creating src/Makefile
config.status: error: cannot find input file: `po/Makefile.in.in'
View 4 Replies
View Related
Oct 7, 2010
i'm a college student studying pc programing, and i was given today a special work and i have to program using miranda... which i've never used it >.< can anyone give me a hand to where to download, how to compile, and a simple tutorial for making a simple program or something?
View 3 Replies
View Related
Feb 6, 2011
I am having trouble understanding some concepts regarding C++ template specialization and I was hopping you guys can help me like you did last time.I will go right into the code and let the code do the talking.File foo.hpp
Code:
// Template Class
template < typename T1, typename T2> struct foo {
[code]....
View 2 Replies
View Related
Sep 8, 2010
I have two functions:
Quote:
void func1(std::string &s)
{
s.clear();
}
[code]....
Is there a way to create one template function for both vector and string that would clear them?
View 4 Replies
View Related
Aug 12, 2010
If I remove all the template stuff, it works.
whats going on here?
View 2 Replies
View Related
Oct 6, 2009
i have trouble to define a static member in a template, and i search from google, but didn't find any similar case, my case is a little complex, i paste the code below.code in xxx.h
Code:
template <class T> class FreeListManager
{
[code]...
View 6 Replies
View Related
Mar 28, 2011
I had some trouble doing this but finally figured it out. Here is a general solution:
Code:
#include <iostream>
using namespace std;
[code]....
View 1 Replies
View Related
Jul 13, 2010
Right now we send notification emails using a velocity template (apache and java), the thing is that the notification engine call the Email.vm file to add all the information and variables. This process only attach the information (text) on the .vm file.
We need to send that email on html. The thing is that if we write the html code on the file, when the .vm file is called that email includes the code not the result of the html.
We have tried adding the headers and everything.
The question is:
Is there some way that we can pre-process the html code and include to that email the result?
Or can we tell the .vm file that it should be handle as html? (like php for example <?php ?>, the <html> and </html> tags doesn't work.
View 1 Replies
View Related
Jun 6, 2011
this should have been a simple task, but for some reason one of my rollovers plain old isn't workingmy html sheet
Code:
<div style="background:#F5F5E9 url('/sites/all/themes/flossmoore1/images/bricks250.png');padding:1px;padding-
[code]....
View 1 Replies
View Related