OpenOCD compile on Windows XP

Hi.

I’ve just started to study OpenOCD.

My environment is Windows XP (download tools from yagato site)

I would like to compile OpenOCD for Windows XP.

When I searched aticles, I just got information for Linux.

Can I have any information how to compile OpenOCD on Windows XP?

Thanks.

For a good start please see:

http://openfacts.berlios.de/index-en.ph … ng_OpenOCD

I’ve successfully built a modified version of release 180 from svn source code. The biggest problem I had was figuring out the proper arguments for the configure command. I built the OpenOCD executable for the ftd2xx driver since I am using an Amontec JTAGKEY dongle.

Good Luck!

Dave Squires

dsquires:
For a good start please see:

http://openfacts.berlios.de/index-en.ph … ng_OpenOCD

Dave Squires

I have set up the environment of mingw. Can I build OpenOCD without Cygwin?

SamT:

dsquires:
For a good start please see:

http://openfacts.berlios.de/index-en.ph … ng_OpenOCD

Dave Squires

I have set up the environment of mingw. Can I build OpenOCD without Cygwin?

OK. I try myself and modify one file from SVN 189

Compiler: mingw, mingw api for mswindows

IDE: Code::Blocks

Procedure:

  1. Since I don’t have myself config.h, I need to modify ./src/flash/at91sam7.c line 37 from ```
    #include “config.h”

#ifdef HAVE_CONFIG_H
#include “config.h”
#endif


2. Set global define parameter in C::B

PARPORT_USE_GIVEIO=1

IS_MINGW=1

_WIN32

3. somefiles which related with cygwin or drivers, I didn't add to compile:

./src/jtag/at91rm9200.c line 29

#include <sys/io.h>

./src/jtag/ep93xx.c line 37

#include <sys/io.h>

./src/jtag/presto.c line 47

#include “ftd2xx.h”

./src/jtag/usbprog.c line 36

#include <usb.h>

./src/target/oocd_trace.h line 27

#include <termios.h>


4. compile message:

-------------- Build: Debug in MyOCD ---------------

Compiling: ..\openocd\src\flash\at91sam7.c

Compiling: ..\openocd\src\flash\cfi.c

Compiling: ..\openocd\src\flash\flash.c

Compiling: ..\openocd\src\flash\lpc2000.c

Compiling: ..\openocd\src\flash\lpc3180_nand_controller.c

Compiling: ..\openocd\src\flash\nand.c

Compiling: ..\openocd\src\flash\non_cfi.c

Compiling: ..\openocd\src\flash\stellaris.c

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_info':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:177: warning: implicit declaration of function `stellaris_read_part_info'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:189: warning: suggest parentheses around + or - in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:194: warning: suggest parentheses around + or - in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:194: warning: suggest parentheses around + or - in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_read_clock_info':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:232: warning: unused variable `tmp'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_read_part_info':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:369: warning: suggest parentheses around + or - in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:370: warning: suggest parentheses around + or - in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_erase_check':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:393: warning: unused variable `target'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:394: warning: unused variable `i'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_protect_check':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:406: warning: unused variable `target'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_protect':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:516: warning: unused variable `cmd'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_write_block':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:637: warning: unsigned int format, pointer arg (arg 6)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:637: warning: unsigned int format, pointer arg (arg 7)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:652: warning: unsigned int format, pointer arg (arg 6)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:652: warning: unsigned int format, pointer arg (arg 8)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c: In function `stellaris_write':

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:730: warning: unsigned int format, pointer arg (arg 6)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:730: warning: unsigned int format, pointer arg (arg 7)

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:725: warning: unused variable `dst_min_alignment'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:725: warning: unused variable `wcount'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:725: warning: unused variable `bytes_remaining'

D:\misc\ARM\jtag linux code\SW\openocd\src\flash\stellaris.c:727: warning: unused variable `fcr'

Compiling: ..\openocd\src\flash\stm32x.c

Compiling: ..\openocd\src\flash\str7x.c

Compiling: ..\openocd\src\flash\str9x.c

Compiling: ..\openocd\src\flash\str9xpec.c

Compiling: ..\openocd\src\helper\binarybuffer.c

Compiling: ..\openocd\src\helper\command.c

Compiling: ..\openocd\src\helper\configuration.c

Compiling: ..\openocd\src\helper\fileio.c

Compiling: ..\openocd\src\helper\interpreter.c

Compiling: ..\openocd\src\helper\log.c

Compiling: ..\openocd\src\helper\replacements.c

Compiling: ..\openocd\src\helper\time_support.c

Compiling: ..\openocd\src\jtag\amt_jtagaccel.c

Compiling: ..\openocd\src\jtag\bitbang.c

Compiling: ..\openocd\src\jtag\bitq.c

D:\misc\ARM\jtag linux code\SW\openocd\src\jtag\bitq.c: In function `bitq_in_proc':

D:\misc\ARM\jtag linux code\SW\openocd\src\jtag\bitq.c:126: warning: suggest parentheses around comparison in operand of &

D:\misc\ARM\jtag linux code\SW\openocd\src\jtag\bitq.c:64: warning: unused variable `result'

Compiling: ..\openocd\src\jtag\ft2232.c

D:\misc\ARM\jtag linux code\SW\openocd\src\jtag\ft2232.c: In function `ft2232_write':

D:\misc\ARM\jtag linux code\SW\openocd\src\jtag\ft2232.c:167: warning: control reaches end of non-void function

Compiling: ..\openocd\src\jtag\gw16012.c

Compiling: ..\openocd\src\jtag\jtag.c

Compiling: ..\openocd\src\jtag\parport.c

Compiling: ..\openocd\src\openocd.c

Compiling: ..\openocd\src\pld\pld.c

Compiling: ..\openocd\src\pld\virtex2.c

Compiling: ..\openocd\src\pld\xilinx_bit.c

Compiling: ..\openocd\src\server\gdb_server.c

D:\misc\ARM\jtag linux code\SW\openocd\src\server\gdb_server.c: In function `gdb_get_packet':

D:\misc\ARM\jtag linux code\SW\openocd\src\server\gdb_server.c:226: warning: unused variable `first_char'

D:\misc\ARM\jtag linux code\SW\openocd\src\server\gdb_server.c:227: warning: unused variable `packet_type'

Compiling: ..\openocd\src\server\server.c

Compiling: ..\openocd\src\server\telnet_server.c

Compiling: ..\openocd\src\target\algorithm.c

Compiling: ..\openocd\src\target\arm720t.c

Compiling: ..\openocd\src\target\arm7_9_common.c

Compiling: ..\openocd\src\target\arm7tdmi.c

Compiling: ..\openocd\src\target\arm920t.c

Compiling: ..\openocd\src\target\arm926ejs.c

Compiling: ..\openocd\src\target\arm966e.c

Compiling: ..\openocd\src\target\arm9tdmi.c

Compiling: ..\openocd\src\target\arm_disassembler.c

Compiling: ..\openocd\src\target\arm_jtag.c

Compiling: ..\openocd\src\target\arm_simulator.c

Compiling: ..\openocd\src\target\armv4_5.c

Compiling: ..\openocd\src\target\armv4_5_cache.c

Compiling: ..\openocd\src\target\armv4_5_mmu.c

Compiling: ..\openocd\src\target\armv7m.c

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c: In function `armv7m_set_core_reg':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c:210: warning: unused variable `armv7m_target'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c: In function `armv7m_run_algorithm':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c:436: warning: unused variable `regvalue'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c:450: warning: unused variable `armv7m_core_reg'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c: In function `armv7m_build_reg_cache':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c:491: warning: unused variable `jtag_info'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c: In function `armv7m_register_commands':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\armv7m.c:576: warning: unused variable `retval'

Compiling: ..\openocd\src\target\breakpoints.c

Compiling: ..\openocd\src\target\cortex_m3.c

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c: In function `cortex_m3_examine_debug_reason':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:207: warning: unused variable `swjdp'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c: In function `cortex_m3_debug_entry':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:284: warning: unused variable `irq_is_pending'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c: In function `cortex_m3_restore_context':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:352: warning: unused variable `cortex_m3'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c: In function `cortex_m3_init_target':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:1270: warning: unused variable `did1'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:1270: warning: unused variable `dc0'

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c: In function `cortex_m3_init_arch_info':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_m3.c:1334: warning: unused variable `jtag_info'

Compiling: ..\openocd\src\target\cortex_swjdp.c

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_swjdp.c: In function `ahbap_block_read_u32':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\cortex_swjdp.c:576: warning: unused variable `blockmax'

Compiling: ..\openocd\src\target\embeddedice.c

Compiling: ..\openocd\src\target\etb.c

Compiling: ..\openocd\src\target\etm.c

Compiling: ..\openocd\src\target\etm_dummy.c

Compiling: ..\openocd\src\target\image.c

Compiling: ..\openocd\src\target\register.c

Compiling: ..\openocd\src\target\target.c

Compiling: ..\openocd\src\target\xscale.c

D:\misc\ARM\jtag linux code\SW\openocd\src\target\xscale.c: In function `xscale_debug_entry':

D:\misc\ARM\jtag linux code\SW\openocd\src\target\xscale.c:1189: warning: implicit declaration of function `xscale_read_trace'

Compiling: ..\openocd\src\xsvf\xsvf.c

Linking console executable: bin\Debug\MyOCD.exe

Process terminated with status 0 (1 minutes, 10 seconds)

0 errors, 39 warnings

OK! Done. I didn't try to hook with my wiggler and will test it next week. Can somebody help to modify the files which I list in procedure 3 because it can't fit with mingw system. TKS!

Test fail because there is no debug interface. Need to add extra global define:

  1. Set global define parameter in C::B

PARPORT_USE_GIVEIO=1

IS_MINGW=1

BUILD_PARPORT=1

_WIN32

and the modify file should be types.h, not at91sam7.c

_WIN32 should already be defined by the win32 api.

You should define IS_WIN32=1 however.

An an idea of what needs defining can be found in the configure.in file, look for AC_DEFINE statement. Just define the interfaces that you require.

Regards

Spen

I want to build a frontend GUI with wxwiget and openocd for download program. but I am not family with C::B. Could you give me a more detailed instruction on how to build the openocd without cygwin. for example the make file? And I will be happy if you can give a total project.

what’s wrong with winsock2.h , It’s in system path. why can’t link?

-------------- Build: Debug in openocd ---------------

Compiling: src\flash\at91sam7.c

E:\CBProject\openocd\src\flash\at91sam7.c: In function `at91sam7_protect’:

E:\CBProject\openocd\src\flash\at91sam7.c:677: warning: unused variable `status’

Compiling: src\flash\cfi.c

Compiling: src\flash\flash.c

Compiling: src\flash\lpc2000.c

Compiling: src\flash\lpc3180_nand_controller.c

Compiling: src\flash\nand.c

Compiling: src\flash\non_cfi.c

Compiling: src\flash\stellaris.c

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_info’:

E:\CBProject\openocd\src\flash\stellaris.c:187: warning: suggest parentheses around + or - in operand of &

E:\CBProject\openocd\src\flash\stellaris.c:192: warning: suggest parentheses around + or - in operand of &

E:\CBProject\openocd\src\flash\stellaris.c:192: warning: suggest parentheses around + or - in operand of &

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_get_flash_status’:

E:\CBProject\openocd\src\flash\stellaris.c:214: warning: unused variable `stellaris_info’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_read_clock_info’:

E:\CBProject\openocd\src\flash\stellaris.c:230: warning: unused variable `tmp’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_flash_command’:

E:\CBProject\openocd\src\flash\stellaris.c:305: warning: unused variable `stellaris_info’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_read_part_info’:

E:\CBProject\openocd\src\flash\stellaris.c:367: warning: suggest parentheses around + or - in operand of &

E:\CBProject\openocd\src\flash\stellaris.c:368: warning: suggest parentheses around + or - in operand of &

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_erase_check’:

E:\CBProject\openocd\src\flash\stellaris.c:390: warning: unused variable `stellaris_info’

E:\CBProject\openocd\src\flash\stellaris.c:391: warning: unused variable `target’

E:\CBProject\openocd\src\flash\stellaris.c:392: warning: unused variable `i’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_protect_check’:

E:\CBProject\openocd\src\flash\stellaris.c:404: warning: unused variable `target’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_protect’:

E:\CBProject\openocd\src\flash\stellaris.c:514: warning: unused variable `cmd’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_write_block’:

E:\CBProject\openocd\src\flash\stellaris.c:635: warning: unsigned int format, pointer arg (arg 6)

E:\CBProject\openocd\src\flash\stellaris.c:635: warning: unsigned int format, pointer arg (arg 7)

E:\CBProject\openocd\src\flash\stellaris.c:650: warning: unsigned int format, pointer arg (arg 6)

E:\CBProject\openocd\src\flash\stellaris.c:650: warning: unsigned int format, pointer arg (arg 8)

E:\CBProject\openocd\src\flash\stellaris.c:625: warning: unused variable `stellaris_info’

E:\CBProject\openocd\src\flash\stellaris.c: In function `stellaris_write’:

E:\CBProject\openocd\src\flash\stellaris.c:728: warning: unsigned int format, pointer arg (arg 6)

E:\CBProject\openocd\src\flash\stellaris.c:728: warning: unsigned int format, pointer arg (arg 7)

E:\CBProject\openocd\src\flash\stellaris.c:723: warning: unused variable `dst_min_alignment’

E:\CBProject\openocd\src\flash\stellaris.c:723: warning: unused variable `wcount’

E:\CBProject\openocd\src\flash\stellaris.c:723: warning: unused variable `bytes_remaining’

E:\CBProject\openocd\src\flash\stellaris.c:725: warning: unused variable `fcr’

Compiling: src\flash\stm32x.c

Compiling: src\flash\str7x.c

Compiling: src\flash\str9x.c

Compiling: src\flash\str9xpec.c

Compiling: src\helper\binarybuffer.c

Compiling: src\helper\command.c

Compiling: src\helper\configuration.c

Compiling: src\helper\fileio.c

Compiling: src\helper\interpreter.c

Compiling: src\helper\log.c

Compiling: src\helper\replacements.c

Compiling: src\helper\time_support.c

Compiling: src\jtag\amt_jtagaccel.c

Compiling: src\jtag\bitbang.c

Compiling: src\jtag\bitq.c

E:\CBProject\openocd\src\jtag\bitq.c: In function `bitq_in_proc’:

E:\CBProject\openocd\src\jtag\bitq.c:124: warning: suggest parentheses around comparison in operand of &

Compiling: src\jtag\jtag.c

Compiling: src\jtag\parport.c

E:\CBProject\openocd\src\jtag\parport.c: In function `parport_led’:

E:\CBProject\openocd\src\jtag\parport.c:252: warning: unused variable `output’

E:\CBProject\openocd\src\jtag\parport.c: In function `parport_quit’:

E:\CBProject\openocd\src\jtag\parport.c:432: warning: unused variable `output’

Compiling: src\jtag\presto.c

E:\CBProject\openocd\src\jtag\presto.c: In function `presto_write’:

E:\CBProject\openocd\src\jtag\presto.c:142: warning: control reaches end of non-void function

E:\CBProject\openocd\src\jtag\presto.c: In function `presto_open’:

E:\CBProject\openocd\src\jtag\presto.c:383: warning: control reaches end of non-void function

Compiling: src\openocd.c

Compiling: src\pld\pld.c

Compiling: src\pld\virtex2.c

Compiling: src\pld\xilinx_bit.c

Compiling: src\server\gdb_server.c

Compiling: src\server\server.c

Compiling: src\server\telnet_server.c

Compiling: src\target\algorithm.c

Compiling: src\target\arm720t.c

Compiling: src\target\arm7_9_common.c

Compiling: src\target\arm7tdmi.c

Compiling: src\target\arm920t.c

Compiling: src\target\arm926ejs.c

Compiling: src\target\arm966e.c

Compiling: src\target\arm9tdmi.c

Compiling: src\target\arm_disassembler.c

Compiling: src\target\arm_jtag.c

Compiling: src\target\arm_simulator.c

Compiling: src\target\armv4_5.c

Compiling: src\target\armv4_5_cache.c

Compiling: src\target\armv4_5_mmu.c

Compiling: src\target\armv7m.c

E:\CBProject\openocd\src\target\armv7m.c: In function `armv7m_set_core_reg’:

E:\CBProject\openocd\src\target\armv7m.c:210: warning: unused variable `armv7m_target’

E:\CBProject\openocd\src\target\armv7m.c: In function `armv7m_run_algorithm’:

E:\CBProject\openocd\src\target\armv7m.c:436: warning: unused variable `regvalue’

E:\CBProject\openocd\src\target\armv7m.c:450: warning: unused variable `armv7m_core_reg’

E:\CBProject\openocd\src\target\armv7m.c: In function `armv7m_build_reg_cache’:

E:\CBProject\openocd\src\target\armv7m.c:491: warning: unused variable `jtag_info’

E:\CBProject\openocd\src\target\armv7m.c: In function `armv7m_register_commands’:

E:\CBProject\openocd\src\target\armv7m.c:576: warning: unused variable `retval’

Compiling: src\target\breakpoints.c

Compiling: src\target\cortex_m3.c

E:\CBProject\openocd\src\target\cortex_m3.c: In function `cortex_m3_examine_debug_reason’:

E:\CBProject\openocd\src\target\cortex_m3.c:209: warning: unused variable `swjdp’

E:\CBProject\openocd\src\target\cortex_m3.c: In function `cortex_m3_debug_entry’:

E:\CBProject\openocd\src\target\cortex_m3.c:286: warning: unused variable `irq_is_pending’

E:\CBProject\openocd\src\target\cortex_m3.c: In function `cortex_m3_restore_context’:

E:\CBProject\openocd\src\target\cortex_m3.c:354: warning: unused variable `cortex_m3’

E:\CBProject\openocd\src\target\cortex_m3.c: In function `cortex_m3_init_target’:

E:\CBProject\openocd\src\target\cortex_m3.c:1272: warning: unused variable `did1’

E:\CBProject\openocd\src\target\cortex_m3.c:1272: warning: unused variable `dc0’

E:\CBProject\openocd\src\target\cortex_m3.c: In function `cortex_m3_init_arch_info’:

E:\CBProject\openocd\src\target\cortex_m3.c:1336: warning: unused variable `jtag_info’

Compiling: src\target\cortex_swjdp.c

E:\CBProject\openocd\src\target\cortex_swjdp.c: In function `ahbap_block_read_u32’:

E:\CBProject\openocd\src\target\cortex_swjdp.c:576: warning: unused variable `blockmax’

Compiling: src\target\embeddedice.c

Compiling: src\target\etb.c

Compiling: src\target\etm.c

Compiling: src\target\etm_dummy.c

Compiling: src\target\image.c

Compiling: src\target\register.c

Compiling: src\target\target.c

E:\CBProject\openocd\src\target\target.c: In function `target_register_user_commands’:

E:\CBProject\openocd\src\target\target.c:888: warning: implicit declaration of function `trace_register_commands’

Compiling: src\target\target_request.c

Compiling: src\target\trace.c

Compiling: src\xsvf\xsvf.c

Linking console executable: bin\Debug\openocd.exe

obj\Debug\src\server\gdb_server.o: In function `gdb_get_char’:

E:/CBProject/openocd/src/server/gdb_server.c:93: undefined reference to `WSAGetLastError@0’

obj\Debug\src\server\gdb_server.o: In function `read_socket’:

E:/CBProject/openocd/src/helper/replacements.h:133: undefined reference to `recv@16’

obj\Debug\src\server\gdb_server.o: In function `write_socket’:

E:/CBProject/openocd/src/helper/replacements.h:124: undefined reference to `send@16’

obj\Debug\src\server\server.o: In function `add_connection’:

E:/CBProject/openocd/src/server/server.c:63: undefined reference to `accept@12’

obj\Debug\src\server\server.o: In function `close_socket’:

E:/CBProject/openocd/src/helper/replacements.h:142: undefined reference to `closesocket@4’

obj\Debug\src\server\server.o: In function `add_service’:

E:/CBProject/openocd/src/server/server.c:142: undefined reference to `socket@12’

E:/CBProject/openocd/src/server/server.c:148: undefined reference to `setsockopt@20’

E:/CBProject/openocd/src/server/server.c:155: undefined reference to `htons@4’

E:/CBProject/openocd/src/server/server.c:157: undefined reference to `bind@12’

E:/CBProject/openocd/src/server/server.c:163: undefined reference to `listen@8’

obj\Debug\src\server\server.o: In function `socket_nonblock’:

E:/CBProject/openocd/src/helper/replacements.h:152: undefined reference to `ioctlsocket@12’

obj\Debug\src\server\server.o: In function `server_loop’:

E:/CBProject/openocd/src/server/server.c:294: undefined reference to `select@20’

E:/CBProject/openocd/src/server/server.c:298: undefined reference to `WSAGetLastError@0’

E:/CBProject/openocd/src/server/server.c:331: undefined reference to `__WSAFDIsSet@8’

E:/CBProject/openocd/src/server/server.c:341: undefined reference to `accept@12’

E:/CBProject/openocd/src/server/server.c:354: undefined reference to `__WSAFDIsSet@8’

obj\Debug\src\server\server.o: In function `server_init’:

E:/CBProject/openocd/src/server/server.c:411: undefined reference to `WSAStartup@8’

obj\Debug\src\server\server.o: In function `server_quit’:

E:/CBProject/openocd/src/server/server.c:434: undefined reference to `WSACleanup@0’

obj\Debug\src\server\telnet_server.o: In function `write_socket’:

E:/CBProject/openocd/src/helper/replacements.h:124: undefined reference to `send@16’

obj\Debug\src\server\telnet_server.o: In function `read_socket’:

E:/CBProject/openocd/src/helper/replacements.h:133: undefined reference to `recv@16’

obj\Debug\src\target\target.o: In function `target_buffer_get_u32’:

E:/CBProject/openocd/src/target/target.c:135: undefined reference to `xscale_target’

collect2: ld returned 1 exit status

Process terminated with status 1 (2 minutes, 33 seconds)

21 errors, 43 warnings

Nothing wrong with it, you have to include the wsock32 lib in the link stage

Cheers

Spen

Sorry for my reply later.

I had linked with {Code::Blocks Install Dir}\lib\libws2_32.a ,is this corrent? I use it compile and C::B report to me 0 error and 43 warnings.

wsock32 lib? you means libwsock32.a or the wsock32.lib(maybe in MSDN).

PS: This is my first time use C::B.(Yesterday I has first install).