0

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

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by lich
0

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.