• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
KF

unable to link 2 object files and 1 header file to form an exe file.

3 posts in this topic

Hi, I am quite new to Dev C++ programming. At present, i am doing an assignment on classes. I have write 3 program named ops.cpp, sum.cpp and ops.h. I have include these 3 file into a project. All 3 file has been successfully compile individually. But when I try to compile the file sum.cpp which will depends on ops.cpp and ops.h, it fail to link ( I think ) . The error is shown below ( copy from compiler failure message : C:\Dev-Cpp\Chapter 8 - tryout\Makefile.win [Build Error] ["Executable] Error 1 Would anyone please help me out ? My individual progrm has already compile successsfully. The make file generated by dev c++ is shown below : # Project: Project isolation classes # Makefile created by Dev-C++ 4.9.9.2 CPP = g++.exe CC = gcc.exe WINDRES = windres.exe RES = OBJ = "Object\ file\ output/sum.o" "Object\ file\ output/ops.o" $(RES) LINKOBJ = "Object\ file\ output/sum.o" "Object\ file\ output/ops.o" $(RES) LIBS = -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/libexec" INCS = -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include assignment" CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include assignment" -I"C:/Dev-Cpp/mingw32/include" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5/mingw32/bits" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5/ext" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5/debug" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5/bits" -I"C:/Dev-Cpp/mingw32/include/c++/3.4.5/backward" -I"C:/Dev-Cpp/mingw32/include/ddk" -I"C:/Dev-Cpp/mingw32/include/gcj" -I"C:/Dev-Cpp/mingw32/include/GL" -I"C:/Dev-Cpp/mingw32/include/gnu/awt/j2d" -I"C:/Dev-Cpp/mingw32/include/gnu/awt" -I"C:/Dev-Cpp/mingw32/include/gnu/classpath" -I"C:/Dev-Cpp/mingw32/include/gnu/gcj/convert" -I"C:/Dev-Cpp/mingw32/include/gnu/gcj/io" -I"C:/Dev-Cpp/mingw32/include/gnu/gcj/runtime" -I"C:/Dev-Cpp/mingw32/include/gnu/gcj" -I"C:/Dev-Cpp/mingw32/include/gnu/java/awt/image" -I"C:/Dev-Cpp/mingw32/include/gnu/java/awt/peer" -I"C:/Dev-Cpp/mingw32/include/gnu/java/awt" -I"C:/Dev-Cpp/mingw32/include/sys" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include assignment" BIN = "Executable file output/Project isolation classes.exe" CXXFLAGS = $(CXXINCS) CFLAGS = $(INCS) RM = rm -f .PHONY: all all-before all-after clean clean-custom all: all-before "Executable file output/Project isolation classes.exe" all-after clean: clean-custom ${RM} $(OBJ) $(BIN) $(BIN): $(OBJ) $(CPP) $(LINKOBJ) -o "Executable file output\Project isolation classes.exe" $(LIBS) "Object\ file\ output/sum.o": D:/Kean\ Fatt\ Document\ 1/C-plus-plus\ assignment/Chapter\ 8\ -\ Harnessing\ Polymorphism/Object\ file\ for\ Chapter\ 8\ -\ Isolating\ class\ structure/sum.cpp $(CPP) -c "D:/Kean Fatt Document 1/C-plus-plus assignment/Chapter 8 - Harnessing Polymorphism/Object file for Chapter 8 - Isolating class structure/sum.cpp" -o "Object file output/sum.o" $(CXXFLAGS) "Object\ file\ output/ops.o": D:/Kean\ Fatt\ Document\ 1/C-plus-plus\ assignment/Chapter\ 8\ -\ Harnessing\ Polymorphism/Object\ file\ for\ Chapter\ 8\ -\ Isolating\ class\ structure/ops.cpp $(CPP) -c "D:/Kean Fatt Document 1/C-plus-plus assignment/Chapter 8 - Harnessing Polymorphism/Object file for Chapter 8 - Isolating class structure/ops.cpp" -o "Object file output/ops.o" $(CXXFLAGS) I have no idea what does the makefile.win about because it does not state any error in my program. Also below is my program for your reference : ops.cpp #include "ops.h" // Reference header file #include <iostream> using namespace std ; Calculator::Calculator() { status = true ; } // Initialize status. void Calculator::launch() // Display instructions. { cout << endl << "***SUM CALCULATOR***" << endl ; cout << "Enter a number, an operator(+,-,*,/), and another number." << endl << "Hit return to calculate. Enter zero to exit." << endl ; } void Calculator::readInput() // Get expression. { cout << ">" ; cin >> num1 ; // Get 1st number. if( num1 == 0 ) status = false ; // Exit if it's zero. else { cin >> oper ; cin >> num2 ; } // Or get the rest. } void Calculator::writeOutput() // Display result. { if ( status ) switch ( oper ) // If continuing. { case '+' : { cout << (num1 + num2) << endl ; break ; } case '-' : { cout << (num1 - num2) << endl ; break ; } case '*' : { cout << (num1 * num2) << endl ; break ; } case '/' : if( num2 != 0 ) cout << (num1 / num2) << endl ; else cout << "Cannot divide by zero" << endl ; } } bool Calculator::run() // Get the current status. { return status ; } sum.cpp #include "ops.h" #include <iostream> using namespace std ; int main() { int Hold_Screen ; Calculator *pCalc = new Calculator ; pCalc -> launch() ; // this is to read instrcutions and write results while ( pCalc -> run() ) { pCalc -> readInput() ; pCalc -> writeOutput() ; } cout << "Please input an integer: " ; cin >> Hold_Screen ; return 0 ; } ops.h class Calculator { public: Calculator() ; // (Constructor) To set initial status void launch() ; // To display initial instructions. void readInput() ; // To get expression. void writeOutput() ; // To display results. bool run() ; // (Accessor) To get current status. private: double num1, num2 ; // To store input numbers. char oper ; // To store input operator. bool status ; // To store current status. } ; Thank you. Anyone, Please guide me through. Your effort is greatly appreciated. Thanks, KF
0

Share this post


Link to post
Share on other sites
First, source tags are your friend. Second, stop using Dev-C++ (and pay attention to the alternatives mentioned, namely Visual Studio and Code::Blocks, they're infinitely better). When you've tried to rebuild the program in either Visual Studio or Code::Blocks, post back here with your results.
0

Share this post


Link to post
Share on other sites
Thank you MikeTacular. I will try out your suggestion and post it here after I have done. Thank you :-)

Best Regards,
KF
0

Share this post


Link to post
Share on other sites
Quote:
Original post by KF
Thank you MikeTacular. I will try out your suggestion and post it here after I have done. Thank you :-)

Best Regards,
KF

Sounds good [smile]. One thing you should notice immediately is that Code::Blocks and Visual Studio are not at all like Dev-C++. They can both be pretty intimidating at first (just because it's a new environment; not because it's hard or anything), so don't be afraid to come back and ask for help if you get stuck or lost along the way. Personally, I'd recommend Visual Studio since you're on a Windows machine (it's debugger is the bomb), but both work just fine.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0