C :: Code Blocks Not Compiling Project - BattleShip Game
Nov 26, 2013
I'm trying to compile my project, but is not working, the weird thing is if i put all the code in 1 file it compile, but not in a project, source code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <windows.h>
[Code] ....
CodeBlocks Project file: Download BattleShip-ProyectoARREGLADO.rar from Sendspace
View 12 Replies
ADVERTISEMENT
Feb 24, 2015
I'm pretty new to C++ and I'm on Binary Trees in "Jumping into C++"! I've just created a DLL project on Code::Blocks, and I cannot get it to build and run: "You must select a host application to "run" a library..." is the message that I'm getting when I run the main code file. It's had no changes to it (except for a few extra, unnecessary line feeds), and it's the file which Code::Blocks generates on a DLL project.
View 13 Replies
View Related
Apr 13, 2014
I have created a game.It is working fine in codeblocks, but when I am trying to run it outside codeblocks, it opens and closes immediately. I have pasted all the necessary files and dlls in root folder and debug folder. Here is the code:-
#include <iostream>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <sstream>
const int WINDOWS_Height = 480;
const int WINDOWS_Width = 640;
[Code] .....
View 2 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
Nov 20, 2014
I was trying to make boost's serialization use less bytes, and I stumbled upon this, which removes the big debugging symbols:
strip --strip-debug
or
strip -w -K '!*serialization*'
This seems like a working command on msys, but how to implement this into code blocks.
View 1 Replies
View Related
Jun 9, 2013
This has happened before, when I try to run a code it will say "blah.exe has stopped working" and I would have to change the code in some way to make it work.
View 1 Replies
View Related
Apr 30, 2013
I'm using Code Blocks but for some reason it doesn't process alt symbols. You know... alt symbols are like this: ☺♫↓☻♪♥↕. Code Blocks says that they're "invalid characters". Is there any attatchments or mods so Code Blocks can process them or will changing the settings?
View 1 Replies
View Related
Jan 30, 2014
I'm unable to use the function random(num); in Code::Blocks. It shows the error : error: 'random' was not declared in this scope while the same code works fine in Borland's Turbo C++. How do I rectify this?
View 6 Replies
View Related
May 15, 2013
I find myself in a position where I am repeating the same pattern of, write shared lib, compile, link shared lib, write app lib "sandbox" dependent on shared lib, write shared lib, compile, link, write...
At each level of dependency I have to carry over previously shared libs, search directories, etc. How to automate this process, so I spend less time linking after each layer?
View 1 Replies
View Related
Dec 28, 2013
how to get opengl working in code blocks? I have tried putting in the libraries and such in the correct folder. But I get an error saying that glut32.dll could not be found. I am running a 10.5 code blocks
View 1 Replies
View Related
May 14, 2014
I've been using code::blocks to work on text files through fstream. But i cannot make it append using my code.
Here's my code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
fstream dataFile;
dataFile.open("demofile.txt", ios::out);
[Code] ....
View 2 Replies
View Related
Aug 27, 2013
In my c project in code blocks , I have added another source file (KillerMoves.c) and a header file under the same name (KillerMoves.h). I added the "include guard" to prevent double inclusion. But from some reason, the program suddenly crashes with no warning or specific error. Without the new files,the program runs without any problems. This is the source .c file:
Code:
#include "KillerMoves.h"
void initKillersTable(){
for(int i = 0; i < 15; i++){
killersTable[i] = -1;
[code]....
View 11 Replies
View Related
Jun 8, 2013
I'm using Code:Blocks 12.11 on windows 7, with the built-in MinGW compiler. When I try and compile a program that has an error in it (misnamed variable, missing include, extra semi-colon somewhere, anything) instead of saying something about what went wrong it just has this:
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
Which is not particularly useful for debugging.
View 11 Replies
View Related
Oct 4, 2014
I want to show my output in one line. But my output breaks to next line even before endl is encountered.code blocks horizontal scroll bar in console? is it c++ formatting issue or console issue?
View 3 Replies
View Related
May 20, 2013
I want to make a basic RPG text based games with multiple classes. but I wan to know how In one class I make a variable and in another and can call the variable.
for exmaple
class2:
int hi = 1;
class1:
class2 a;
hi = 2;
cout << hi;
2
View 1 Replies
View Related
Apr 29, 2013
I downloaded glew 1.9.0 files and dragged the lib, include, and bin of the glew into the mingw folder within Code Blocks. I don't know if this is the right thing to do I don't understand how this stuff works. Anyway, I tried to compile my openGL 3.0 program that uses glew and I got this error: The procedure entry point _glewBindArray could not be located in the dynamic link library glew32.dll, How do I install glew properly?
View 1 Replies
View Related
Jan 26, 2015
This program works on an online compiler but force closes on codeblocks after entering the elements.
#include<iostream>
using namespace std;
int two_print(int x, int one[999]) {
int two[999][999];
for(int k=0, r=x; k<=x; k++, r--)
[code]....
View 6 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
Mar 28, 2013
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.
View 5 Replies
View Related
Apr 19, 2014
How to compile this source code and make a binary file
I think this need linux and run make command or gcc
This binary is a super user for android
source code attached
Attached File(s) : su.zip (7.59K)
View 3 Replies
View Related
Sep 10, 2013
I am creating an application which will work as a static code analyzer after compiling my code in VS 2008 for VC++ projects. It will be a kind of code review.
how and where do I need to put my custom rule sets, and what should I do to create such a application.
View 4 Replies
View Related
Jun 23, 2014
How to structure something like Game Menu. I was googling and did not find anything useful. I am coding a little game and Menu part with few sections like START GAME - SELECT LEVEL - SETTINGS (SOUND, MUSIC AND VIBRATION ON/OF) - CREDITS - EXIT.
And just menu alone seems to have tones of code. I have my state machine working but it seems every subsection of the menu has its own state sort if and duplicate code.
View 2 Replies
View Related
Jan 3, 2015
I want to create a top trumps game using pseudo code with variables, loops, If statements and inputs, how would I write it?
View 3 Replies
View Related
Dec 26, 2013
So far I have managed to write the code for a simple game (resembling to "Pacman") :P. Now what I want is to move the smiley in the upper left-hand corner of the map "automatically" when the program runs and also want it to change it's direction to up or down when it touches the wall.
Also the screen is flickering when the program runs (due to re-printing the whole array?). I want to stop this flicker. Somebody suggested to use 'gotoxy' function.
Here's my code :
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
void display (char array [10][25] , int row , int column) {
[Code] .....
View 8 Replies
View Related
Jan 22, 2014
I have a project which does a specific thing, like an open file dialog.
I would like to open it in a different project on a click of a button.
Also, It has a different namespace.
I'm guessing that it would involve a "using" statement to add the namespace And I will have to add reference to an *.exe or *.dll -> I'll have to look up how to make a *.dll, I know where the *.exe file is.
I have searched for a different things on Google, but I don't think that I am looking for the correct phrase (which is always frustrating...)
View 12 Replies
View Related
Dec 21, 2014
I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.
The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.
How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?
View 4 Replies
View Related