Re: Confusing undefined function which I know is defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/11/2013 05:57, Jonathan Wakely wrote:
> mingw32-gcc.exe -ansi -D_DLL -D_UNICODE -DUNICODE  -shared -D_WIN32
> -DZXBUILD_DLL -D_WINDLL    -Iinclude -I  -c
> C:\Me\Prjs\cpp\zxStuff\svn\trunk\src\zx\event\zxEVENT.c -o
> .objs\src\zx\event\zxEVENT.o
> C:\Users\Lee\AppData\Local\Temp\cczuTp1t.o:zxEVENT.c:(.data+0xfc):
> undefined reference to `zxVECTOR_resize'
> C:\Users\Lee\AppData\Local\Temp\cczuTp1t.o:zxEVENT.c:(.data+0x100):
> undefined reference to `zxVECTOR_opAdd'
> c:/apps86/tools/codeblocks12-11/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:
> C:\Users\Lee\AppData\Local\Temp\cczuTp1t.o: bad reloc address 0x100 in
> section `.data'
> collect2.exe: error: ld returned 1 exit status
> Process terminated with status 1 (0 minutes, 3 seconds)
> 2 errors, 0 warnings (0 minutes, 3 seconds)
> 
> 
> As I thought, the errors shown are linker errors, not compiler errors.
>  You are using -shared to compile single object files, that is wrong.
> You probably want to use -fPIC to compile each file, then use -shared
> to combine them into a single .dll file.  So your codeblocks settings
> must be wrong, but that is not a GCC problem so this is the wrong
> mailing list.
> 

No, -fpic does not have any function for mingw, it is likely because
-shared and -c are used at the same time.

The linker should not be involved yet if it is just compiling to object.


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux