ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
SORRY: THE HEADLINE IS WRONG... I resolved the undefined reference to main error but still
cannot get my Makefile to work...
I get some weird undefined reference errors:
In function 'main':
wlan/include/wlan_modem.h: undefined reference to 'cWlan:PLCP::TXSTART_req(...)'
although wlan_modem.h does not make any call to this function ??? More info below, in my
firt posting:
-------------------------------------------------------------------------------------------
Hi... I've been stuck the whole day trying to build this @#%$@$!! program on linux (I am a VC++ user..., works fine there). Can anyone help me out? I'm cannot afford to lose more time one this....
My test program is called wlan_test.cpp and this is the one I need to make
an executable for.
My Makefile without the compilation and linking steps looks as follows:
INCLUDE = /user/niko/NP_NEW/extern/include
LIBS = /user/niko/NP_NEW/extern/lib #I am using libfftw3.h libgsl.a and
#libgslcblas.a here
#QUESTION:
#WHAT SHOULD I PUT HERE TO GET TO BUILD THE EXECUTABLE FILE
#wlan_test to be build? (including the -I and -L options for my include path
#and library path (fftw and gsl - header files in #directory /user/niko/extern/include and .a files in extern/lib
#I tried many things but they always give me some error of undefined #reference to the library functions, or even to 'main', etc...
#thanks for your help!
but I get some weird undefined reference errors:
In function 'main':
wlan/include/wlan_modem.h: undefined reference to 'cWlan:PLCP::TXSTART_req(...)'
although wlan_modem.h does not make any call to this function ???
Make sure wlan_modem.h does not include any file that uses that undefined functions. It may be that you have two files of the same name: one in your project and one somewhere in the system libraries. If the wrong one is included, you may have such problem. Try the locate commands to search for files (especially includes) with conflicting names.
The tmp: line looks quite fine. I'd only put simply -o tmp_test instead of -o $@
You probably need to -l a library associated with that include when you link. Even if the header doesn't call the function it's probably declared somewhere (that header or another it includes.) It's also possible that the library you're linking to leaves it undefined so that another library will define it, or maybe it expects the final program to define it.
ta0kira
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.