C :: Conflicting Types Error When Compiling A Lib
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
ADVERTISEMENT
Jan 22, 2014
I have this
Code:
#include<stdio.h>
#include<ctype.h>
#include<string.h>
int check_up(char string[]);
int check_low(char string[]);
void to_up(char string[]);
void to_low(char string[]);
[Code] .....
When I compile this I have the following problems: warning: data definition has no type or storage class [enabled by default] in 'to_up(word)'conflicting types in 'to_up' function and to_low function warning: data definition has no type or storage class [enabled by default] into_up function error: unknown type name "word" in line 'printf("All uppercase %s. ", word):;'warning: parameter names (without types) in function declaration [enabled by default] in 'to_up(word)'and 'to_low(word)' 'note: previous declaration of "to_up" was here in function declaration of to_up function
View 7 Replies
View Related
Mar 6, 2015
In my project i need to calculate the distance between two lattitude and longitude points. After compiling the code I am getting an error that "conflicting types for deg2rad". How to solve this? Seems the code looks ok. but...
Code:
#include <math.h>
#define pi 3.14159265358979323846
double distance(double lat1, double lon1, double lat2, double lon2, char unit) {
double theta, dist;
[Code] .....
View 4 Replies
View Related
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
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
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
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
Oct 11, 2013
I am working on a double linked list and inside of my function to insert a node, I am getting an error of "Incompatible types in assignment". Here is my function code. Line 55 is where I am receiving the error.
Code:
45 struct lnode *ins_llist(char data[], struct llist *ll){
46 struct lnode *p, *q;
47
48 q = malloc(sizeof(struct lnode));
49 if ( q == NULL )
[Code]....
View 2 Replies
View Related
Mar 23, 2014
So I get errors like:
Error1error C2440: 'initializing' : cannot convert from 'const char [4]' to 'Course'
Error2error C2440: 'initializing' : cannot convert from 'int' to 'Course'158
Error3error C2440: 'initializing' : cannot convert from 'const char [6]' to 'Course'158
Error4error C2078: too many initializers158
# include <iostream>
# include <cstring>
#include <iomanip>
#include <cmath>
using namespace std;
class Course {
public:
char CourseName[10]; // Array of size 10, 9 characters and 1 null terminator
[Code] .....
And in the /// part I also need to use the dot operator and the arrow operator to print on the screen info about the second and third Courses.
View 3 Replies
View Related
Oct 22, 2014
I making a simple single number scrambler/encryptor and as I tried to build the console application the following error
occurred:
error: invalid operands of types 'void' and 'int' to binary 'operator%'
The source code is bellow.
#include <iostream>
#include <math.h>
#include <cstdlib>
using namespace std;
int main() {
int nTimer;
int nInput;
[Code]......
I am running code::blocks as my IDE on Ubuntu.
View 2 Replies
View Related
Nov 24, 2014
i have the following error defines.h:14:23: error: two or more data types in declaration specifiers, the begining define.h source code is (the line 14 is in red):
Code:
/* $Id: defines.h 3492 2011-09-18 20:44:09Z nekral-guest $ */
/* some useful defines */
#ifndef _DEFINES_H_
#define _DEFINES_H_
[Code]....
View 8 Replies
View Related
Jun 17, 2014
I am having this error where it declares two of the same identifier, but I cannot figure it out.
Error C237 states:
The identifier is already declared.
Example
// C2371.cpp
int main() {
int i;
float i; // C2371, redefinition
float f; // OK
}
Though in my code I cannot find a redefinition anywhere.
texturemanager.h
#ifndef TEXTUREMANAGER_H
#define TEXTUREMANAGER_H
#include <SDL.h>
#include <SDL_image.h>
#include <iostream>
#include <string>
[Code] ....
My complete Error states as this:
Error3error C2371: 'TextureManager::load' : redefinition; different basic type line:4
Error2error C2556: 'TextureManager TextureManager::load(std::string,int,int,int,int,SDL_Renderer
*,SDL_RendererFlip)' : overloaded function differs only by return type from 'bool TextureManager::load(std::string,int,int,int,int,SDL_Renderer *,SDL_RendererFlip)' line: 4
Error1error C2628: 'TextureManager' followed by 'bool' is illegal (did you forget a ';'?) line:3
IDE: Visual Studio 2012
View 4 Replies
View Related
Nov 22, 2013
The code is supposed to convert characters from an array into their respective ascii integers, and append a 0 if the number is less than 3 digits long. It then supposed to put it all together into one string.
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
char file[] = "This is a test";
char *ptr = file;
int length = strlen(file);
int i, numbers[length];
[Code] .....
View 4 Replies
View Related
Jan 18, 2015
I'm completely new to pointers and have a homework assignment due where I'm supposed to create a user defined dynamic array for player scores. The only errors I'm experiencing is a C2109: subscript requires pointer type and only on the lines that use the int *score; variable (57, 62, 64, 69, 71, and 82). I've already tried adding = nullptr to the variable and that didn't work.
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
void players(string[], int[], int);
void average(int[], int);
[Code] ....
View 3 Replies
View Related
Jan 22, 2013
The Light and Fan are two different vendor classes and they are not derived from any base class. I am trying to implement the Command design pattern but with generic implementation, so it should work in future with any new vendor class like Door, Window etc without much change in client code. I have thought about a Factory method but it will not work because it needs a Base class. I am trying to learn the design patterns.
Light *myobj;
Fan *myobj;
int choice;
cout<<"Select Light (1): ";
cout<<"Select Fan (2): ";
[Code] ....
Error:conflicting declaration 'Fan*myobj'
View 14 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