ok heres the deal...
i took a C++ class as an undergrad WAAAAAY back in the day and have forgot almost all of it. i recently DLed a C++ program that came with several files. i have tried to run this program to see if i obtain the same results they do in their paper. the files are as follows:

Main.cc: contains the main time loop
Header.h: contains some function definitions
Variables.h: definition of object containing all state variables
Variables.cc: creation of object, writing of state backups
Step.cc: computes a single time step

-can be found at:

i am using the Dev-C++ program with no modifications. i loaded up the file Main.cc and tried to compile it but it came up with a few errors including several link errors. among the source code files is a text file called makefile.txt that seems to have paths (links) to the source files, but i have no clue how to make the compiler look in the makefile.txt. any help would be greatly appreciated. i have been lookin at tons of tutorials and introductions to C++ but can't seem to find anything relevant to my problem. Thanks.

-jason

Dani AI

Generated

A short clarification that ties the thread together: ’s download contained several translation units (Main.cc, Variables.cc, Step.cc plus headers) and the linker errors were the symptom of the build not combining all of them. ’s Dev‑C++ directory notes are about tool configuration, but the core issues are how the compiler and linker are invoked and how global symbols are declared—creating a project (as ultimately did) is one simple way to make the IDE compile and link every source file together.

Key practical points and commands (GCC/MinGW style): compile-and-link all sources in one step, or compile to objects and then link:

g++ Main.cc Variables.cc Step.cc -o hvm.exe
g++ -c Main.cc
g++ -c Variables.cc
g++ Main.o Variables.o Step.o -o hvm.exe

Common linker causes and fixes (explainers relevant to the files named in the thread):

  • “undefined reference” / “unresolved external” means a function or variable was declared but not linked because its .o was not included or a library flag was missing.
  • “multiple definition” usually means a non‑inline symbol was defined in a header that was #include’d by more than one .cc. For globals, the safe pattern is to put a declaration in the header and a single definition in one .cc. Example pattern:
/* Variables.h */
extern MyState globals;

/* Variables.cc */
MyState globals;

Also use include guards or #pragma once in headers to avoid multiple inclusion of declarations.

Notes about Dev‑C++ / makefiles / downloads: adding all source files to a Dev‑C++ project ensures the IDE invokes the compiler and linker correctly. A supplied makefile.txt can be used if renamed and run with an appropriate make program (MinGW/MSYS make or mingw32-make), but beware absolute paths inside a downloaded makefile—those often need editing. When link errors remain, the most useful diagnostics are the exact linker messages and the short declarations/definitions involved.

First of all what compiler are u using? I am a newbie at programming and studying it through an institute. The Dev C++ program has got al lot of errors and the one main error that most of the students that, are studying at the same institute, complained about r link errors. U got to set up the program through the tools -> complier options -> directories.

go to binaries and type the following
c:\folder name\devcpp\bin
c:\ folder name\your compiler\bin

go to the libraries and type the same as above but instead of bin at type lib
go to c include and type the same again but instead of lib type include
go to c++ includes type C:\yourfolder\devcpp\include\c++
and then type C:\your folder\devcpp\include\c++\mingw32 (mingw32 is part of the complier i am not sure about this)
type the following C:\your folder\devcpp\include\c++\backward
type C:\unisa\devcpp\include

I hope this helps to find makefile.txt files I am not sure what you mean but there is a library called the fstream libraries. If this is what you want i could give you some info from some books that i have.

nm, figured it out; had to create a project to link source files and stuff.
-jason

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.