User forums > Using Code::Blocks
How to build dll on win32
siomek:
Hello,
I tried many times build dll library, but I have a lot of problems. With build static library there are no problems. Are there any rules for build dll library for win32? Have I to add any dependencies?
Defender:
If you describe, what your problem is, we could help you :)
thomas:
You are probably not asking about choosing "DLL" from the combobox in build options, I assume.
If your problems are due to missing symbols, you are very likely programming in C++ and are a victim to name mangling. In that case, add extern "C", and you'll be fine :)
siomek:
I did that on sequence (build FANN library, http://leenissen.dk/fann/ ) :
1. File->New Project->Dynamic Link Library (options: Do not create any files). Project named fann_dll (simple :-))
2. On Managment->Projects->Workspace->fann_dll->Add files. I've added *.c and *.h files.
3. Build->Rebuild.
The log is:
-------------- Build: default in fann_dll ---------------
Compiling: ..\..\include\doublefann.c
Compiling: ..\..\include\fann.c
Compiling: ..\..\include\fann_cascade.c
Compiling: ..\..\include\fann_error.c
Compiling: ..\..\include\fann_io.c
Compiling: ..\..\include\fann_train.c
Compiling: ..\..\include\fann_train_data.c
Compiling: ..\..\include\fixedfann.c
Compiling: ..\..\include\floatfann.c
Linking dynamic library: fann_dll.dll
.objs\include\fann.o(.text+0x0):fann.c: multiple definition of `fann_create_standard'
.objs\include\doublefann.o(.text+0x0):doublefann.c: first defined here
.objs\include\fann.o(.text+0xc9):fann.c: multiple definition of `fann_create_sparse'
.objs\include\doublefann.o(.text+0xc9):doublefann.c: first defined here
.objs\include\fann.o(.text+0x9a8):fann.c: multiple definition of `fann_create_shortcut'
.objs\include\doublefann.o(.text+0x9b7):doublefann.c: first defined here
.objs\include\fann.o(.text+0xdd7):fann.c: multiple definition of `fann_run'
.objs\include\doublefann.o(.text+0xdec):doublefann.c: first defined here
.objs\include\fann.o(.text+0x1a62):fann.c: multiple definition of `fann_randomize_weights'
.objs\include\doublefann.o(.text+0x1b58):doublefann.c: first defined here
.objs\include\fann.o(.text+0x1ad9):fann.c: multiple definition of `fann_print_connections'
.objs\include\doublefann.o(.text+0x1be3):doublefann.c: first defined here
.objs\include\fann.o(.text+0x1d65):fann.c: multiple definition of `fann_init_weights'
.objs\include\doublefann.o(.text+0x1e6f):doublefann.c: first defined here
.objs\include\fann.o(.text+0x2009):fann.c: multiple definition of `fann_print_parameters'
.objs\include\doublefann.o(.text+0x2113):doublefann.c: first defined here
.objs\include\fann.o(.text+0x23b0):fann.c: multiple definition of `fann_get_num_input'
.objs\include\doublefann.o(.text+0x24c0):doublefann.c: first defined here
.objs\include\fann.o(.text+0x23ef):fann.c: multiple definition of `fann_get_total_connections'
.objs\include\doublefann.o(.text+0x24ff):doublefann.c: first defined here
.objs\include\fann.o(.text+0x23bb):fann.c: multiple definition of `fann_get_num_output'
.objs\include\doublefann.o(.text+0x24cb):doublefann.c: first defined here
.objs\include\fann.o(.text+0x23c6):fann.c: multiple definition of `fann_get_total_neurons'
.objs\include\doublefann.o(.text+0x24d6):doublefann.c: first defined here
.objs\include\fann.o(.text+0xa4e):fann.c: multiple definition of `fann_create_shortcut_array'
.objs\include\doublefann.o(.text+0xa5d):doublefann.c: first defined here
.objs\include\fann.o(.text+0x2930):fann.c: multiple definition of `fann_allocate_connections'
.objs\include\doublefann.o(.text+0x2a4b):doublefann.c: first defined here
.objs\include\fann.o(.text+0x184e):fann.c: multiple definition of `fann_destroy'
.objs\include\doublefann.o(.text+0x1944):doublefann.c: first defined here
.objs\include\fann.o(.text+0x2832):fann.c: multiple definition of `fann_allocate_neurons'
.objs\include\doublefann.o(.text+0x294b):doublefann.c: first defined here
.objs\include\fann.o(.text+0x23fa):fann.c: multiple definition of `fann_allocate_structure'
.objs\include\doublefann.o(.text+0x250a):doublefann.c: first defined here
.objs\include\fann.o(.text+0x29c1):fann.c: multiple definition of `fann_seed_rand'
.objs\include\doublefann.o(.text+0x2adc):doublefann.c: first defined here
.objs\include\fann.o(.text+0x176):fann.c: multiple definition of `fann_create_sparse_array'
.objs\include\doublefann.o(.text+0x176):doublefann.c: first defined here
.objs\include\fann.o(.text+0xa6):fann.c: multiple definition of `fann_create_standard_array'
.objs\include\doublefann.o(.text+0xa6):doublefann.c: first defined here
.objs\include\fann_cascade.o(.text+0x0):fann_cascade.c: multiple definition of `fann_print_connections_raw'
.objs\include\doublefann.o(.text+0x8a59):doublefann.c: first defined here
.objs\include\fann_cascade.o(.text+0x6a):fann_cascade.c: multiple definition of `fann_cascadetrain_on_data'
.objs\include\doublefann.o(.text+0x8ac3):doublefann.c: first defined here
.objs\include\fann_cascade.o(.text+0x2a9):fann_cascade.c: multiple definition of `fann_cascadetrain_on_file'
.objs\include\doublefann.o(.text+0x8d02):doublefann.c: first defined here
.objs\include\fann_cascade.o(.text+0x54b):fann_cascade.c: multiple definition of `fann_reallocate_connections'
.objs\include\doublefann.o(.text+0x8fa4):doublefann.c: first defined here
.objs\include\fann_cascade.o(.text+0x6e1):fann_cascade.c: multiple definition of `fann_reallocate_neurons'
.objs\include\doublefann.o(.text+0x913a):doublefann.c: first defined here
Process terminated with status 1 (0 minutes, 6 seconds)
52 errors, 0 warnings
The same project made for static library I've builded successfully. I was the same problems with other libraries.
MortenMacFly:
--- Quote from: siomek on May 19, 2006, 07:16:43 pm ---I did that on sequence (build FANN library, http://leenissen.dk/fann/ ) :
--- End quote ---
What I did was:
- downloaded FANN (the fann-2.0.0.zip file - the sources)
- imported the workspace from the "MicrosoftVisualC++6.0" folder
- clicked "Build workspace"
...and everything works properly (using MinGW on Win32).
With regards, Morten.
Edit: According to the sources that are imported that way I wonder why you compile "doublefann.c", too? This is not part of the workspace...?!
Navigation
[0] Message Index
[#] Next page
Go to full version