Re: linking qt3 to a library
Quote:
Originally Posted by
thebra
INCLUDEPATH += /home/Minuit-1_7_6/include
LIBS += -L/home/Minuit-1_7_6/lib -llcg_Minuit
It looks OK. Did you remember to rerun qmake to get a new Makefile?
Re: linking qt3 to a library
yes I did using qmake -o Makefile code.pro and then make
Re: linking qt3 to a library
Can you post the exact error message?
Re: linking qt3 to a library
Thanks for your replies. After I type make I get the following (where the MODEL functions below are defined in minuit library)
----------------------------------------------------------------------------------------------------------------------------
g++ -c -g -w -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fomit-frame-pointer -march=i586 -mtune=pentiumpro -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -Iheader -I/home/Minuit-1_7_6/include -I/usr/lib/qt3//include -o code.o code.cpp
In file included from code.cpp:28:
code.ui.h: In member function `virtual void Code::test()':
code.ui.h:1931: error: no matching function for call to `MODEL::MODEL(std::vector<double, std::allocator<double> >&, <unknown type>, std::vector<double, std::allocator<double> >&)'
header/version.h:5: error: candidates are: MODEL::MODEL(const MODEL&)
header/version.h:12: error: MODEL::MODEL(const std::vector<double, std::allocator<double> >&, const std::vector<double, std::allocator<double> >&, const std::vector<double, std::allocator<double> >&)
{standard input}: Assembler messages:
{standard input}:146100: Error: Local symbol `.LTHUNK0' can't be equated to undefined symbol `_ZN4BnmrD1Ev'
{standard input}:146100: Error: Local symbol `.LTHUNK1' can't be equated to undefined symbol `_ZN4BnmrD0Ev'
make: *** [bnmr.o] Error 1
------------------------------------------------------------------------------------------------------------------------------
Re: linking qt3 to a library
Quote:
Originally Posted by
thebra
code.ui.h:1931: error: no matching function for call to `MODEL::MODEL( ... <unknown type> ...)'
header/version.h:5: error: candidates are: MODEL::MODEL(const MODEL&)
header/version.h:12: error: MODEL::MODEL(...)
It looks like something on line 1931 in code.ui.h is causing troubles. What do you have there?
Quote:
Originally Posted by
thebra
{standard input}:146100: Error: Local symbol `.LTHUNK0' can't be equated to undefined symbol `_ZN4BnmrD1Ev'
{standard input}:146100: Error: Local symbol `.LTHUNK1' can't be equated to undefined symbol `_ZN4BnmrD0Ev'
Do you use Bnmr class somewhere? It looks like you have declared a Bnmr::~Bnmr() destructor, but you didn't implement it.
Re: linking qt3 to a library
MODEL function is defined in the minuit library and called in version.h. Bnmr was defined in the header file as well. In fact the code compiles fine without linking to the minuit library ( as I remove the line 1931).
Re: linking qt3 to a library
Quote:
Originally Posted by
thebra
MODEL function is defined in the minuit library and called in version.h.
Judging from the compiler error, you just use it in a wrong way, or the header file is wrong --- note the "<unknown type>" in the error message. What parameter are you trying to pass to MODEL::MODEL()?
Re: linking qt3 to a library
I am trying to pass data in form of ( x, y, dy) to be fitted using the minuit library. The code works perfect when compiled using a command line. But it doesn't when adjusted to fit in a GUI. Is it linking problem or just problems with unknown classes? I will check that again. But do you think there is nothing wrong with code.pro? Thanks
Re: linking qt3 to a library
Quote:
Originally Posted by
thebra
Is it linking problem or just problems with unknown classes?
That error message comes from the compiler, not linker, so either you have some typo in your code or missing #include directive.
Quote:
Originally Posted by
thebra
But do you think there is nothing wrong with code.pro?
Yes, it looks OK.
Re: linking qt3 to a library
I figured it out and it had to do with how classes of the C++ code were defined. Thanks for your help.