Hello there.

I'm having a problem with a linker error. I am trying to compile a project (just a hobby). It manages to compile, but I get a link error when trying to link. I don't see anything wrong with the code at all.

I am using Dev-C++. This is the error:

[Linker error] undefined reference to 'std::ios_base::ios_base(std::ios_base const&)'

ld returned 1 exit status

C:\Documents and Settings\Marco\My Documents\interpreter\Makefile.win [Build Error] [interpreter.exe] Error 1

Could anyone please help me? I would appreciate it.

Recommended Answers

All 3 Replies

A lot of times when you have a linker error, it means that one of your functions is looking for a function prototype ( the things that you usually put in a header file so that other functions can call each other ). That's what we use #include for.

In this case your made some includes, declared main, and then made some includes below main. You might want to try to see if you're still getting the linker errors after you put all your includes at the top of your cpp file.

I still get the linker error, even after you suggestion.

Did you make the correct includes in your hpp files as well?

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.