I have a project in Visual Stuio 2012 Express and I would like to include a static library, compiled with gcc
from MinGW
. I included the library i nthe project options of the project.
Not working. Next I tried with a mockup minimal library.
test.c
int foo(){return 5;}
cmd:
gcc -c test.c
ar rcs libtest.a test.o
objdump:
C:\ARM_Workpsace - Legacy\HardwareEmulation\build>objdump -t test.o
test.o: file format pe-i386
SYMBOL TABLE:
[ 0](sec -2)(fl 0x00)(ty 0)(scl 103) (nx 1) 0x00000000 test.c
File
[ 2](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 1) 0x00000000 _testfun2
AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 0
[ 4](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .text
AUX scnlen 0xa nreloc 0 nlnno 0
[ 6](sec 2)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 8](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[ 10](sec 4)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .rdata$zzz
AUX scnlen 0x11 nreloc 0 nlnno 0
[ 12](sec 5)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .eh_frame
AUX scnlen 0x38 nreloc 1 nlnno 0
But VS2010 still returns the same error:
1>------ Rebuild All started: Project: ReverbTwo, Configuration: Debug Win32 ------
1> ReverbTwo.cpp
1> RackAFXDLL.cpp
1> pluginobjects.cpp
1> plugin.cpp
1> Generating Code...
1>plugin.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
1> Creating library C:\Users\user\AppData\Roaming\RackAFX\PlugIns\ReverbTwo.lib and object C:\Users\user\AppData\Roaming\RackAFX\PlugIns\ReverbTwo.exp
1>ReverbTwo.obj : error LNK2019: unresolved external symbol "int __cdecl testfun2(void)" (?testfun2@@YAHXZ) referenced in function "public: __thiscall CReverbTwo::CReverbTwo(void)" (??0CReverbTwo@@QAE@XZ)
1>C:\Users\user\AppData\Roaming\RackAFX\PlugIns\ReverbTwo.dll : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========