I've recently downloaded the original DOOM source code from id Software's GitHub page. I decided it would be fun to port it to Windows 7. I created a new Win32 application within Microsoft Visual Studio 2010 Professional, added all the DOOM files to the project, and hit compile. I got a ton of odd errors, so I switched the project from C++ to C and hit compile again. I got a few more errors, which I've mostly resolved (they come from the fact that the DOOM code I downloaded was written for Linux in 1993), and an error on nearly every symbol in cmath. The errors are C2059 and C2061. A little bit of digging around online revealed that these errors come from including cmath in a C project. However, I can find no reference to cmath in my code files.
A little more digging around online revealed that certain C++ files, like fstream, include cmath. I removed all of those that I could, but to no avail. How I can get rid of these errors?
All the code in this project so far can be found at [URL] ....
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: }
what my compiling errors mean, and what I should do to fix them: The following is my header & Implementation files. Note, the purpose of this class is a built in Array.
I've written a simple program that output's my name, course, and a time date stamp.
Having researched the code to do so, I've used the includes for both the ctime and time.h libraries.
I leveraged localtime_s and asctime_s to actually convert to string etc., and the program runs fine when I step through it in Visual Studio.
However, we're working with CGI and this program will ultimately be called up from the cgi-bin directory of a web server. The first thing that needs to be done after copying it to the webserver is to compile it. That's where my problem occurs.
Using the console command: g++ lab5a.cpp -o lab5a.exe the file is supposed to compile and be converted to a .exe.
However, instead I receive errors:
localtime_s was not declared in this scope asctime_s was not declared in this scope
I "believe" it's because of the included libraries, but not sure.
They are:
HTML Code: #include <iostream> #include <ctime> #include <time.h>
Here's the actual timestamp block of code:
HTML Code: //Begin date and time instructions time_t curTime; struct tm locTime; const int TimeStrLen = 26;
[Code] ....
Of course, I go on to error check and complete the block, but you get the picture.
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'
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:-
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
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: /* 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?
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.
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.
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:
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?
I'm working on my program that takes input of the employees' first and last name, their payrate, their deferred from check and also the amount of hours they have worked which then the gross is calculated and also the taxes are calculated by an external function. In the program design it is necessary to put arrays which I have done, but when i compile I receive warning messages
Code: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'double'
Warning: format '%f' expects a matching 'double' argument [-Wformat] which I believe is causing my program to just give me garbage when I run it. What do those warnings mean?
Problem: When I add a new variable to complete my program, it crashes. I have tried tracing where the problem is but it leads to adding new variables
Purpose of program: Every 2 lines of the input file belong to 1 participant. The line with decimals include times a person has run miles. While the second line of each participant are integers that indicate the best sets from workouts the participant had done.
so an example of the output
Participant #1 Cardio Workouts: Best Time: Worst Time: Average Time: Weight Workouts: Most Sets: Least Sets: Average Sets:
Participant #2 ...
Why my program is crashing
#include <stdio.h> int main () { // Stats Col0=BestTime Col1=WorstTime col2=mostSets col3=leastSets Col4=Average_time Col5=Average_sets float chart[20][12], stats[10][6], best_time=100, worst_time=0, most_sets=0, least_sets=100, avg_time, avg_sets, sum; int i, j; int p=0;
I am working on a school project and am stuck in the debugging. I am compiling with g++ and am using c++11.
Error message
In file included from /usr/include/c++/4.7/algorithm:63:0, from date.h:7, from date.cpp:1, from schedule.h:1, from schedule.cpp:1, from date_driver.cpp:1:
[Code] ....
Here are my overloaded operators for my date class.
I have been trying to compile a static version of the boost libraries, however when I try to launch the program it says fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-s-1_53.lib'
I have checked in the boost/stage/lib folder and that file is not there. I compiled boost with b2 link=static yet the file still isn't there.
Has compiled Matrox Imaging Library using Visual Studio 2010. I have downloaded MIL and trying to compile a simple program in the installed directory called 'msimple.cpp', but getting the following error: