[Dev-C++] Problem linking to simple library
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: matt <mat...@pa...> - 2003-05-27 17:09:08
|
I am newbie to devcpp but an experienced UNIX programmer. I have the
simplest example possible that I cannot
get to link. I keep getting undefined reference error even though the
library is found by the linker (since
when I change the name it complains):
I am using the latest beta version , but the help calls the version 4.9.8.0
Here is the error:
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe votest.o -o "votest.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib"
-s -mwindows lib/libm.a libtestx.a
votest.o(.text+0x3a):votest.c: undefined reference to `mysub'
Here are the simple sources :
votest.c:
#include "testx.h"
int main(int argc, char *argv[])
{
int x;
x = 1;
x = mysub( x );
printf("x=%d\n", x);
system("PAUSE"); return 0;
}
Here is the library source:
textx.c:
#include <stdio.h>
int mysub( int x )
{
x = x + 1;
return ( x );
}
|