如何提供链接时找不到的功能
How to provide functions that cannot be found at linking?
当我尝试编译我的应用时,我会得到两个错误:
$ g -static -emit -swf -o cloudclient.swf -i ../boost/boost/boost_libraries/install -dir/incluct -i ../ffm peg-1.0/bin/include -l ../boost/boost_libraries/install-dir/lib -l ../ffmpeg-1.0/bin/lib timer.o audio_encoder.o audio_generator.o video_encoder.o video_generator_rainbow.o sim ple_synchronizer.o多路复用器.o transmitter.o graph_runner.o cloud_client.o -lswscale -lavformat -lavcodec -lavcodec -lavutil -lboostrongystem -lboostrongystem -lboost_date_date_time_time -lboost_thread -pthread -pthread -pthread -pthread -lm
lm
../ffmpeg-1.0/bin/lib/libswscale.a: error: undefined reference to 'exp'
../ffmpeg-1.0/bin/lib/libavcodec.a: error: undefined reference to 'log'
collect2: ld returned 1 exit status
如果log
和exp
是我的问题,如果我放置-lm
的任何地方,我无济于事,我想知道如何从字面上创建自己的存根而代替exp
和log
并将我的Libs与它们联系起来?....
您将在c文件中实现它们(而不是由C编译器编译,而不是C 编译器),或在C 文件中实现它们,然后给出然后给出外部" C"链接。例如:
extern "C" double log(double x)
{
// ...
}
显然,解决链接问题会更好。您不必提供自己的标准C库例程的版本。
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- HDF5 构建了并行支持,但找不到特定于 mpi 的功能
- 找不到超载的成员功能,类位于标题中
- 在OPENCV 3中找不到OpenCV 2 Delaunay三角剖分功能
- 传递到功能时找不到C 矢量
- 是否有可以将每个双精度转换为唯一uint64_t,保持精度和顺序的功能?(为什么我找不到?
- 找不到GLFW功能
- 如何提供链接时找不到的功能
- calc_min找不到reducer_min_index的功能
- 错误:控制到达非无效功能的末尾.找不到修复错误的位置
- 为什么C++找不到模板功能?
- SDL 找不到我的主要功能
- 在开源项目中找不到功能Get_AacEncoder,即使在系统中也是如此
- 八度发烧:找不到功能
- 找不到绘图功能的C++包含文件
- 找不到某些提升库功能