undefine reference to'qMain(int,char**)'
2014-04-08 10:06
197 查看
编译错误:undefine reference to `qMain(int, char**)'
前两天写了个简单的QT测试程序,编译出现一个问题:c:\Qt\4.3.0\lib/libqtmain.a(qtmain_win.o)(.text+0x1f7):qtmain_win.cpp: undefine
reference to `qMain(int, char**)'
然后上网查阅了一下,居然没有找到相应的解决方法,最后向一个师兄请教,才找到问题的原因,记录下来:
因为我那个main.cpp文件是后来加过去的,所以在.pro文件中SOURCES那一行少加了main.cpp,所以出现错误找不到qMain函数。
原先.pro文件中:
# Input
HEADERS += My3D.h
SOURCES += My3D.cpp
改后:
# Input
HEADERS += My3D.h
SOURCES += My3D.cpp main.cpp
相关文章推荐
- InttoChar
- error C2664: 'atof' : cannot convert parameter 1 from 'int' to 'const char *'
- undefined reference to std::basic_ostream<char @GLIBCXX_3.4.9
- error: cast from ‘char*’ to ‘int’ loses precision
- caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.
- error: cast from ‘char*’ to ‘int’ loses precision
- 【笔记】编译报错error: cannot convert ‘main(int, char**)::sockadrr*’ to ‘const sockaddr*’ for
- qt create 编译嵌入式软件提示undefine reference to 'ts_read_raw'
- no matching function for call to ‘std::basic_string<char>::assign(std::string&, int)
- mainwindow.cpp:(.text+0x91b2): undefined reference to `endpoint_se(QVector<double>, int,............
- atoi char and string to int
- build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)'
- 解决undefine reference to '__aeabi_idiv' undefine reference to '__aeabi_idivmod'错误
- Code::Blocks undefine reference to ‘XXX函数’
- Android NDK r6b使用stl遇到undefined reference to `std::__node_alloc::_M_allocate(unsigned int&)” 的终极解决办法
- undefined reference to cv::imread(cv::String const&, int)
- undefine reference to pthread_create
- 解决编译opencv3.0时出现的问题undefined reference to `parallel_pthreads_set_threads_num(int)'
- incompatible pointer types assigning to 'int *' from 'char'
- IP Char to Int