Hello.
I have library that has been written in Ansi C named "edr.a" and header file "edr.h". Library hass been compiled on 32-bit ubuntu and is linked into project but I get undefined references to all methods defined in header file.
Please take a look on this simple example:
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include "edr.h"
  4.  
  5. MainWindow::MainWindow(QWidget *parent) :
  6. QMainWindow(parent),
  7. ui(new Ui::MainWindow)
  8. {
  9. ui->setupUi(this);
  10.  
  11. SetDebugMode(); // this is method defined in edr.h
  12. }
To copy to clipboard, switch view to plain text mode 
edr.h file:
Qt Code:
  1. long SetDebugMode(void);
  2. long ClearDebugMode(void);
To copy to clipboard, switch view to plain text mode 
This is what compilator is showing:
Qt Code:
  1. g++ -c -m32 -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-32 -I../Lib -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I../LinkowanieBiblioteki -I../Lib -I. -I. -I. -o moc_mainwindow.o moc_mainwindow.cpp
  2. g++ -m32 -o LinkowanieBiblioteki main.o mainwindow.o moc_mainwindow.o -L -ledr -lQtGui -lQtCore -lpthread
  3. mainwindow.o: In function `MainWindow':
  4. /home/neon/workspace/qt4/LinkowanieBiblioteki-build-desktop/../LinkowanieBiblioteki/mainwindow.cpp:14: undefined reference to `SetDebugMode'
To copy to clipboard, switch view to plain text mode 
What I'm doing wrong? How to use linked external library written in Ansi C?