C :: Compiling Makefile - Error
Feb 5, 2013
I've a problem compiling my makefile. The additional files are enclosed.
the error I get:
$make ./main
gcc -ggdb main.c
/tmp/ccPIxwjP.o: In function `main':
/home/ilan/Embedded_linux/Lesson-2-Makefiles/lesson-2.1/main.c:6: undefined reference to `func1'
/home/ilan/Embedded_linux/Lesson-2-Makefiles/lesson-2.1/main.c:7: undefined reference to `func2'
collect2: error: ld returned 1 exit status
make: *** [main.o] Error 1
$
Code:
my make file:
main : main.o file1.o file2.o
gcc -ggdb main.o file1.o file2.o -o gdb-main
main.o : main.c file1.h file2.h
[Code] .....
View 4 Replies
ADVERTISEMENT
Jul 25, 2014
I'm having a constant error in my DLL regarding one simple function: I get the error:
double *(double)' differs in levels of indirection from 'double (double)'
The declaration is:
extern EXP32 double *FAR PASCAL_CONV utc2tdb(double jd);
What can be the problem?
View 1 Replies
View Related
Mar 18, 2014
Code:
#include<stdio.h>
#include<strings.h>
main() {
} struct employ {
char name[50];
float age ;
[Code] .....
View 2 Replies
View Related
Mar 6, 2013
Code:
/* Demonstrates using the gets() return value. */
#include <stdio.h>
/* Declare a character array to hold input, and a pointer. */
char input[257], *ptr;
[Code]....
I just got this from the book that I am using and it is for testing for input of a blank line and readers are being warned in using this format (line 18):
Code: while ( (*ptr = gets(input)) != NULL)
What is the correct syntax if a gcc compiler is to be used?
View 8 Replies
View Related
Dec 24, 2014
I'm trying to compile a library for use with PoLabs Pokeys 56U USB device (PoKeys56U) on Linux Mint 17 64-bit.
I'm using the information from here - New cross-platform library for all PoKeys devices - MyPokeys
When I run
sudo make -f Makefile.noqmake install
I get the following errors;In file included from PoKeysLibCore.c:22:0:
PoKeysLib.h:38:28: error: conflicting types for "int64_t"
typedef long long int64_t;
^
In file included from /usr/include/stdlib.h:314:0,
from PoKeysLibCore.c:21:
[Code] ....
Here is the offending code from the header file;
Code:
#ifndef __POKEYSLIB
#define __POKEYSLIB
#define USE_STD_INT
#ifdef USE_STD_INT
#include "stdint.h"
[Code] ....
View 12 Replies
View Related
May 10, 2014
I am working on a small project which contains three files
1. MainTest.cpp
2. CashRegister.h
3. CashRegister.cpp
I have done everything that suppose to be done but still I am getting an error and can not execute the program....
Code:
// MainTest.cpp
#include <iomanip>
using std::setw;
using std::left;
#include <iostream>
using std::cout;
[Code] ....
View 14 Replies
View Related
Jan 17, 2013
When I try to compile a program from a C book I am following I am getting these errors, I have looked for ways to resolve it but I wasn't able to.
Errors:
Error3error LNK2001: unresolved external symbol _druk_instructiesC:UsersIvoDocumentsVisual Studio 2012ProjectsConsoleApplication2ConsoleApplication2Handspel.objConsoleApplication2
Error4error LNK2001: unresolved external symbol _speler_keuzeC:UsersIvoDocumentsVisual Studio 2012ProjectsConsoleApplication2ConsoleApplication2Handspel.objConsoleApplication2
Error5error LNK2001: unresolved external symbol _machine_keuzeC:UsersIvoDocumentsVisual Studio
[Code] .....
The .h file:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#ifdef __cplusplus
extern "C"
[Code] .....
View 2 Replies
View Related
Nov 8, 2014
Every time I try to compile this, I get the error message, "error: no matching function for call to" on lines 18, 45, and 46. Basically every time I try to call on the function sales and printStock. I don't know what the message means or why I get it.
#include <iostream>
#include <fstream>
#define N 10
using namespace std;
void printStock (float [], int);
float sales (float [], int);
[Code] .....
View 6 Replies
View Related
Mar 23, 2014
I am compiling and every time I get this error on this line ....
#include "r3dPCH.h"
#include "r3d.h"
#include "r3dBackgroundTaskDispatcher.h"
#include "d3dfont.h"
#include "GameCommon.h"
#include "Gameplay_Params.h"
#include "UIHUD_TPSGame.h"
#include "ObjectsCode/AI/AI_Player.h"
[Code] .....
View 1 Replies
View Related
Aug 7, 2014
What is dependency in Makefile.
Secondly I have made Makefile but cannot use make -f . How to use it?
Third what is make [OPTION] [TARGET]
View 4 Replies
View Related
Aug 1, 2014
use makefiles, how to create a makefile with cpp files and the binary file in different directories.
These are my directories:
Project/
|
|-makefile
|
|__src/__.cpp files
|
|
|__bin/__ .exe
|
|
|__inc/__ .h files
|
|
|__obj/__ .o files
I have done this:
CC = g++
CFLAGS = -I.
SRCDIR = src
OBJDIR = obj
BINDIR = bin
INCDIR = inc
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
[Code] .....
but console says "no rule to make target main.cpp, needed by project"
View 2 Replies
View Related
Jan 31, 2014
How do I compile a more than one executables? If I have two rules to compile an executables, after it compiles the first, it will stop.
a: a.h a.cpp
g++ a.h a.cpp
b: b.h b.cpp
g++ b.h b.cpp
View 9 Replies
View Related
Mar 15, 2013
Why this makefile only executes the first entry, compiling only the first program listed?
###########################################################
#
# Simple Makefile for Operating Systems Project 2
#
###########################################################
vowcon:
g++ -o vowcon vowcon.cpp -pthread
osproj2c:
g++ -o osproj2c osproj2c.cpp -pthread
osproj2b:
g++ -o osproj2b osproj2b.cpp -pthread
osproj2a:
gcc -o osproj2a osproj2a.c -pthread
clean:
rm osproj2a osproj2b osproj2c osproj2d vowcon
View 7 Replies
View Related
Mar 29, 2012
How do I check for ldconfig in a makefile? This makefile errors because it tries to run ldconfig, even though OS = Darwin
Code:
ifeq ($(SHARED),1)
install: banner install_headers $(lib_target)
@echo "Install shared library"
cp -f ./$(lib_target) $(inst_path)
cd $(inst_path) ;
[Code] ....
Errors
Code:
/bin/sh: -c: line 0: syntax error near unexpected token `Darwin,Darwin'
/bin/sh: -c: line 0: `ifneq (Darwin,Darwin)'
make: *** [install] Error 2
make: ldconfig: No such file or directory
make: *** [uninstall] Error 1
View 3 Replies
View Related
May 18, 2013
I would like to call a script from a makfile to glean some information about the OS. What I more or less need is the OS name and version (CentOS-5.9, OPENSUSE-12.2, Cygwin, etc). I think I can get the rest of what I need from uname. The OS name and version doesn't seem to reside in any consistent place over the various Linux flavors. I also need to get the version of the gnu c compiler, since I think that may also require a bit more involved scripting than I would like to try out of make.
The main question is weather I can call a script out of make and have it return a value for a variable.
Something like,
OS := $(shell ./script_name)
View 1 Replies
View Related
Mar 17, 2014
I have called a C function inside C++ code. The .so which gets created is a 32 bit while I am looking for 64 bit . What all options should be mentioned in the Make file to eventually compile and get shared object of ELF64 CLASS ?
Excerpts from Makefile
-----------------------------
CC = gcc
CXX = g++
CPPFLAGS = -I. -I$(S) -DHAVE_CONFIG_H
CFLAGS = -O2 -pipe
CXXFLAGS = -g -O2
LDFLAGS =
LIBS = -lsocket -lnsl
[Code] .....
View 1 Replies
View Related
May 20, 2013
I'm trying to create a Makefile for a single fie ( mycod.c)
What is the syntax?
View 2 Replies
View Related
Mar 20, 2012
I'm taking an intro to c++ class and during an exercise I ran into multiple errors that are out of my knowledge to fix. The rest of the class is using Visual and that is all the instructor knows so i'm in my own figuring out Xcode. Basically I wrote the same program twice but one has a different struct and I get all sorts of errors with it. understand what the errors are and why they occurred.
The working program is this:
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
struct point {
public:
double x1,y1;
double x2,y2;
[code]....
This program does not compile and I get the following errors:
stl_iterator_base_types.h
1) Symantic Issue
No type named 'value_type' in 'myPoint'
2) Symantic Issue
No type named 'iterator_category in 'myPoint'
3) Symantic Issue
No type named 'difference_type' in 'myPoint'
4) Symantic Issue
No type named 'pointer' in 'myPoint'
5) Symantic Issue
No type named 'reference' in 'myPoint'
Why does one work and the other doesn't!?
View 14 Replies
View Related
Apr 30, 2015
I'm compiling some open source code (originally written for Linux / gcc) which uses the following line to determine if a particular section is being compiled for an x86 processor:-
Code:
#if ( defined(__x86_64__) || defined(__i386__) )
neither of those seems to be defined by my ageing compiler (VC++ 8.0). What would be the equivalent for building with VC8 ?
View 6 Replies
View Related
Sep 8, 2013
have several linux header files included and when I compile my program I get the below errors..Am I NOT supposed to use some of these headers? Source is below as well.Looking through the headers mentioned in these errors, it's looking like stuff really is defined in multiple places...
Code:
codeblox@Lubuntu-pc:~/Programming/C/Network/MITM/src$ gcc -g -o mitm *.c
In file included from mitm.h:12:0,
from create_raw.c:1:
/usr/include/netpacket/packet.h:22:8: error: redefinition of ‘struct sockaddr_ll’
In file included from /usr/include/linux/netdevice.h:30:0,
from /usr/include/linux/if_arp.h:26,
from mitm.h:10,
from create_raw.c:1:
}
[code]....
View 5 Replies
View Related
Sep 22, 2014
I want to use two separate files in 1 program, but cannot get it to work. I don't know if it's my files or the compiling thats wrong. I have never used 2 files in my programs so far. Only used #include <stdio.h>.
Here are my files:
extern_static.c Code: extern int i;
int main(void)
{
[Code]....
View 10 Replies
View Related
Mar 28, 2013
I have a FTP server, client program and thus I can easily transfer files, however what I want is to modify the program such that server receives a c/c++ file, compiles the output, and sends a text file back to the client containing the output. The program should also take note that errors are also transferred.
View 9 Replies
View Related
Jun 25, 2014
I'm working for implementing the binary search tree .Everything looks fine but on compiling the code , the program got crashed .
code :
#include<iostream>
#include<stdio.h>
using namespace std;
[Code]......
View 1 Replies
View Related
Oct 21, 2014
I am trying to compile two programs using the same header file and definitions. makefile part to make this work.
================================
My headerfile looks like this:
#ifdef ONE
void hello(int s);
#else
[Code]....
How can I include the flag -DONE in my makefile so that
it includes void hello(int s); for "one" and
int pin;
int verification(char* name);
for "two"
View 2 Replies
View Related
Sep 7, 2012
In a rather large codebase, there is a set of recurring calls to a couple vararg functions (mainly for logging)
Code: logthis(foo, bar(), somefunction(parameter1,parameter2), somethingelse);
The number of parameters to this function is variable It has all types of variables, function calls, etc.
The code has thousands of these lines
There is now a need for a special version of the compile that will remove a lot of the code, among others is the logging.
Can I somehow #define the "logthis" name into something that'll remove all actual calls to the code. including the actual parameters/expressions to the call.
I can't afford to add #ifdef/#endif around each of the calls because there are too many of them, and because that'll cause some undisired side effects in our code conformance tests.
Code: #define logthis __noop
comes close, that removes the call, but it still causes the compiler to evaluate and validate all the parameters to the logthis function, which doesn't work because in this case, removing the logging headers also removes other members of the class that get used as part of the parameters to logthis()
if I could define logthis into // resulting in all the rest of the line being comments, but that doesn't work.
Preferably I'd like something to be portable, but I'll take a solution that only works on visual studio as well.
View 6 Replies
View Related
Oct 26, 2013
I'm creating a small command line game in C. I have never done anything cross platforms, but this is small enough (so far) that it might not be too bad.
When I am done, I'm not sure how it will be distributed: Either I will just send people the C files and say "compile on your system with these options", or I will just have executables for various systems. Probably Windows 7/8, Ubuntu, CentOS, and whatever I can find to test on.
I right now I'm testing/developing on Windows 7 using MinGW. So my questions are: while I'm developing, how should I be compiling/testing it?
View 4 Replies
View Related