Hi I am getting an undefined reference error from my code
here is a snippet of my code.

#include <stdio.h>
#include <windows.h>

//defining functions
void ErrorFunc(int error);

int error = 0;

int main(void){
    return 0;
}

void ErrorFunc(int error)
{
    FunctionFromALibrary(error);
}

I am using DEVC++ 5 and I have included the library that I need to use in the project-project options-parameters - linker
there i have:

thisLibrary.lib
-lmingw32

I also added that directory in
project-project options-directory-directories-library directories

it is at least partially linked because if i hold my mouse of the
FunctionFromALibrary()
DEVC++ will show me the prototype

Recommended Answers

All 3 Replies

ok well i solved this question by switching to visual c++ 2008
but i dont like it :P

thisLibrary.lib
-lmingw32

You need to check the naming convention, and whether (or not) you need the initial -l
For example, saying mingw32 could really mean libmingw32.lib

Any libraries of your own would need to follow the same naming convention.

check the names are correct.. the library names.. check it correctly

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.