- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
一段时间以来,我一直在为这个烦人的未解析外部符号而苦苦挣扎。我只是似乎没有找到错误在哪里,我的库似乎已链接,但不知何故编译器看不到它。
2>win_main.obj : error LNK2019: unresolved external symbol "void * __cdecl nedalloc::nedmalloc(unsigned int)" (?nedmalloc@nedalloc@@YAPAXI@Z) referenced in function "private: static void * __cdecl Seventh::AllocatedObject::allocateBytes(unsigned int)" (?allocateBytes@AllocatedObject@Seventh@@CAPAXI@Z)
2>win_main.obj : error LNK2019: unresolved external symbol "void __cdecl nedalloc::nedfree(void *)" (?nedfree@nedalloc@@YAXPAX@Z) referenced in function "private: static void __cdecl Seventh::AllocatedObject::deallocateBytes(void *)" (?deallocateBytes@AllocatedObject@Seventh@@CAXPAX@Z)
2>C:\Users\X\X\X\SeventhEngine\Debug\SeventhEngineExamples.exe : fatal error LNK1120: 2 unresolved externals
我正在尝试链接到 nedmalloc dll 导出的库,我已经使用框架依赖项 链接了它,并将它包含在其他库中。我还使用 NEDMALLOC_DLL_EXPORTS
编译了库,以确保 __declspec(dllexport)
标志。
如果您想看一下,可以查看完整的源代码(包括 VS2010 解决方案和项目):
https://github.com/albertofem/SeventhEngine
我几乎可以肯定这是一个设置问题。另外,请随时发布有关此设置的任何建议和意见。
提前致谢。
更新
Dump of file nedmalloc.dll
File Type: DLL
Section contains the following exports for nedmalloc.dll
00000000 characteristics
507C8192 time date stamp Mon Oct 15 23:35:14 2012
0.00 version
1 ordinal base
43 number of functions
43 number of names
ordinal hint RVA name
1 0 000110FA nedblksize = @ILT+245(_nedblksize)
2 1 0001129E nedcalloc = @ILT+665(_nedcalloc)
3 2 00011069 nedcreatepool = @ILT+100(_nedcreatepool)
4 3 00011041 neddestroypool = @ILT+60(_neddestroypool)
5 4 000110FF neddestroysyspool = @ILT+250(_neddestroysyspool)
6 5 00011050 neddisablethreadcache = @ILT+75(_neddisablethreadcache)
7 6 0001121C nedflushlogs = @ILT+535(_nedflushlogs)
8 7 00011203 nedfree = @ILT+510(_nedfree)
9 8 0001138E nedfree2 = @ILT+905(_nedfree2)
10 9 00011159 nedgetvalue = @ILT+340(_nedgetvalue)
11 A 00011343 nedindependent_calloc = @ILT+830(_nedindependent_calloc)
12 B 00011325 nedindependent_comalloc = @ILT+800(_nedindependent_comalloc)
13 C 000112C1 nedmallinfo = @ILT+700(_nedmallinfo)
14 D 0001126C nedmalloc = @ILT+615(_nedmalloc)
15 E 00011055 nedmalloc2 = @ILT+80(_nedmalloc2)
16 F 0001105F nedmalloc_footprint = @ILT+90(_nedmalloc_footprint)
17 10 00011299 nedmalloc_internals = @ILT+660(_nedmalloc_internals)
18 11 00011023 nedmalloc_stats = @ILT+30(_nedmalloc_stats)
19 12 0001128F nedmalloc_trim = @ILT+650(_nedmalloc_trim)
20 13 000110C3 nedmallopt = @ILT+190(_nedmallopt)
21 14 000112BC nedmemalign = @ILT+695(_nedmemalign)
22 15 000110AF nedmemsize = @ILT+170(_nedmemsize)
23 16 00011073 nedpcalloc = @ILT+110(_nedpcalloc)
24 17 000113CF nedpfree = @ILT+970(_nedpfree)
25 18 00011253 nedpfree2 = @ILT+590(_nedpfree2)
26 19 000112E9 nedpindependent_calloc = @ILT+740(_nedpindependent_calloc)
27 1A 00011136 nedpindependent_comalloc = @ILT+305(_nedpindependent_comalloc)
28 1B 000111F4 nedpmallinfo = @ILT+495(_nedpmallinfo)
29 1C 000110AA nedpmalloc = @ILT+165(_nedpmalloc)
30 1D 000112AD nedpmalloc2 = @ILT+680(_nedpmalloc2)
31 1E 00011208 nedpmalloc_footprint = @ILT+515(_nedpmalloc_footprint)
32 1F 000113A2 nedpmalloc_stats = @ILT+925(_nedpmalloc_stats)
33 20 0001125D nedpmalloc_trim = @ILT+600(_nedpmalloc_trim)
34 21 000112DF nedpmallopt = @ILT+730(_nedpmallopt)
35 22 00011113 nedpmemalign = @ILT+270(_nedpmemalign)
36 23 000112F8 nedpoollist = @ILT+755(_nedpoollist)
37 24 0001119A nedprealloc = @ILT+405(_nedprealloc)
38 25 000110F5 nedprealloc2 = @ILT+240(_nedprealloc2)
39 26 000111B8 nedpsetvalue = @ILT+435(_nedpsetvalue)
40 27 00011078 nedrealloc = @ILT+115(_nedrealloc)
41 28 00011267 nedrealloc2 = @ILT+610(_nedrealloc2)
42 29 00011311 nedsetvalue = @ILT+780(_nedsetvalue)
43 2A 0001105A nedtrimthreadcache = @ILT+85(_nedtrimthreadcache)
Summary
1000 .data
1000 .idata
3000 .rdata
1000 .reloc
1000 .rsrc
12000 .text
10000 .textbss
最佳答案
为了将函数标记为 extern "C"
,您还需要定义 NO_NED_NAMESPACE
:
#if defined(__cplusplus)
#if !defined(NO_NED_NAMESPACE)
namespace nedalloc {
#else
extern "C" {
#endif
.
.
.
如您所见,extern "C"
仅在定义了 NO_NED_NAMESPACE
时添加。
关于c++ - 有点复杂的 Visual Studio 解决方案中未解析的外部符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12920356/
我对 Powershell 很陌生,正在设置我的 profile.ps1 文件。我有一些托管 DLL,我经常使用它们来维护全天的进程,我希望能够通过快速函数调用加载它们。所以我在我的 ps1 文件中创
实际上我正在处理让我的代码在 IE 中运行的问题。不幸的是这仍然是必要的。 不受支持的方法的 Polyfill 工作正常。但我想知道,如何/是否可以使“const”和“let”起作用。有什么办法可以做
我有一个按钮,它将 window.location 设置为一个 php 文件,该文件生成一个提要,然后下载该提要。但是,由于文件的大小因放入提要的数据而异,有时从单击按钮到弹出文件对话框可能需要一段时
在 iOS 中获取以下内容的最佳方式是什么: 3 个按钮 (?),点击后会更改显示的信息。我有一些想法,但我想听听有经验的人的意见。我问的是如何获得它的外观,最好是一个接一个地使用按钮吗?如果是的话,
int trees = 3; int tree_x, tree_y; for(int r = 0; r 0) { tree_x = random() % m_townsize;
我看过很多关于 C++ 工厂的帖子,但到目前为止我还没有看到解决我的问题的解决方案。 (虽然我可能遗漏了一些东西。) 示例控制台应用程序: #include #include #include
因此,我在 中有 X 幅图像要垂直居中(下面 jquery 中的类名是实际的 )。这工作得很好但是......它只采用第一个值并将其应用于其余图像,导致第一个居中而其他不居中。 我可能会补充一
好吧,正如您可能看出来的那样,我很难想出一个标题。无论如何,我需要从数据库中选择 5 个项目,不包括第一个项目。更具体地说,我在数据库中有项目,每个项目都有一个特定的、自动递增的 ID。我需要选择 I
给定一个项目数组,每个项目都有一个值和成本,什么是最好的算法来确定达到最小值所需的项目最低成本? 例如: Item: Value -> Cost ------------------- A 2
所以,如果你尝试像这样做一个嵌套类: //nestedtest.php class nestedTest{ function test(){ class E extends
是否可以仅深拷贝特定类型的对象,例如列表、字典或元组 示例:[[1, ], ] 我想深度复制第一个列表(当然还有.. 1),但不是SomeObj或 OtherObj .那些应该作为引用。 是否可以使用
跳至上次编辑 我有一个 Person 对象列表,我需要使用 randomize_pairs 函数将它们随机配对,每个 Person 对象都有一个属性目标他们与谁配对。 我的限制是没有人可以与自己配对(
最好用 ruby,但逻辑就足够了...... 考虑到一周是非标准的,我需要一年中的周数。因此,假设您将一周定义为周六 -> 周五。那么,给定一个日期,它是第几周 (1-52)? strftime
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我有这样的模式规则: $(BIN_DIR)/%: $(SOURCES_DIR)/%/*.c $(CC) $? $(CFLAGS) $(LDFLAGS) -o $@ $(LDLIBS) $(LI
CREATE DATABASE 'some database name' ; 使用 mysql 客户端按预期工作。 来自 php/mysqli 的相同查询(不同的数据库名称)- 有点失败。它写入 IN
我有一个 iPhone 应用程序,它本质上是一个列表。顶部有一个 UINavigationBar,然后有一个保存列表的 UITableView。我希望以某种方式提供一个选项,允许用户以不同的方式对列表
我的客户想要的可能实际上是不可能的 - 他们想要一个不裁剪并保留其尺寸的全屏背景图像。他们愿意接受空白,但他们希望图像尽可能地填满屏幕,而不在任何轴上裁剪。我能够找到很好的脚本来实现真正的整页背景,但
我有两个表:文章和文章标签 articles: id, author, date_time, article_text articletags: id, tag (article.id == arti
我正在开发一个模拟器,供应商可以在其中创建由消费者购买的报价。 提供商将报价放在价格(y 轴)x 质量(x 轴)平面上。 消费者只会购买价格低于他们偏好但质量更高的商品 消费者购买具有最大欧氏距离的商
我是一名优秀的程序员,十分优秀!