Discussion:
Undefined symbols in fann.c: find_function()
Ed Cottrell
2007-12-18 20:28:21 UTC
Permalink
Hello all,



In trying to compile the gsoc2007 branch, I get a ton of "undefined
reference" errors in fann.c in find_function(). The symbols in question are
all, apparently, function names, yet I can't find any of them in any of the
files in the CVS tree.



My compiler output (mingw, development environment Code::Blocks, platform
Windows Vista Home Premium):



-------------- Build: Debug Double Win32 in windll ---------------



Compiling: ..\src\fann.c

Compiling: ..\src\fann_cascade.c

Compiling: ..\src\fann_error.c

Compiling: ..\src\fann_gng.c

Compiling: ..\src\fann_io.c

Compiling: ..\src\fann_recurrent.c

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c: In function
`fann_train_hopfield':

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c:123: warning:
comparison between signed and unsigned

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c:127: warning:
comparison between signed and unsigned

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c: In function
`fann_create_fully_recurrent':

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c:193: warning:
comparison of unsigned expression >= 0 is always true

C:\Users\Ed\Documents\CProjects\fann-gsoc\src\fann_recurrent.c:194: warning:
comparison of unsigned expression >= 0 is always true

Compiling: ..\src\fann_som.c

Compiling: ..\src\fann_train.c

Compiling: ..\src\fann_train_data.c

Linking dynamic library: Debug Double Win32\fanndoubled.dll

Creating library file: Debug Double Win32\libfanndoubled.a

Debug Double Win32\src\fann.o: In function
`find_function':C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:113:
undefined reference to `fann_layer_constructor_connected_any_any'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:123: undefined
reference to `fann_layer_constructor_sse_batch_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:125: undefined
reference to `fann_layer_constructor_sse_batch_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:127: undefined
reference to `fann_layer_constructor_sse_rprop_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:129: undefined
reference to `fann_layer_constructor_sse_rprop_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:140: undefined
reference to `fann_neuron_constructor_connected_any_any'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:142: undefined
reference to `fann_neuron_constructor_blas_batch_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:144: undefined
reference to `fann_neuron_constructor_blas_batch_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:146: undefined
reference to `fann_neuron_constructor_blas_rprop_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:148: undefined
reference to `fann_neuron_constructor_blas_rprop_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:150: undefined
reference to `fann_neuron_constructor_sse_batch_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:152: undefined
reference to `fann_neuron_constructor_sse_batch_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:154: undefined
reference to `fann_neuron_constructor_sse_rprop_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:156: undefined
reference to `fann_neuron_constructor_sse_rprop_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:158: undefined
reference to `fann_neuron_constructor_scalar_batch_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:160: undefined
reference to `fann_neuron_constructor_scalar_batch_sigmoid_symmetric'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:162: undefined
reference to `fann_neuron_constructor_scalar_rprop_sigmoid'

:C:/Users/Ed/Documents/CProjects/fann-gsoc/src/fann.c:164: undefined
reference to `fann_neuron_constructor_scalar_rprop_sigmoid_symmetric'

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

17 errors, 4 warnings





Can anyone help me understand this?



Thanks,

Ed
Vincenzo Di Massa
2007-12-18 23:19:11 UTC
Permalink
Post by Ed Cottrell
Debug Double Win32\src\fann.o: In function
undefined reference to `fann_layer_constructor_connected_any_any'
Errors like this one means that, the project files are not linking in all the
object files needed to compile fann libraries.

I'm only able to compile using linux+gcc atm, but I can help you debugging the
windows project files if you like.

First of all: what are you using to compile fann?
We are using also the CMake buildsystem from www.cmake.org (should make things
easier on other platforms)...
so first of all plaese try to generate the project files using cmake (on
windows it should be able to create MSVC project).

If that fails: what object files is your linker linking together? I can't see
that info from your post :-(

I hope we can fix it together

Regards
Vincenzo

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Ed Cottrell
2007-12-19 00:07:40 UTC
Permalink
Hi Vincenzo,

Thanks for getting back to me. I recognized the errors, but can't figure out
which object files are missing.

I am compiling using mingw, called from the Code::Blocks development
environment on Windows Vista. It worked well for the 2.1 stable release, but
not for the gsoc2007 code. I'll try CMake and see if that improves things.

Thanks,
Ed


-----Original Message-----
From: fann-general-bounces-5NWGOfrQmneRv+***@public.gmane.org
[mailto:fann-general-bounces-5NWGOfrQmneRv+***@public.gmane.org] On Behalf Of Vincenzo Di
Massa
Sent: Tuesday, December 18, 2007 5:19 PM
To: FANN General and development discussion
Subject: Re: [Fann-general] Undefined symbols in fann.c: find_function()
Post by Ed Cottrell
Debug Double Win32\src\fann.o: In function
undefined reference to `fann_layer_constructor_connected_any_any'
Errors like this one means that, the project files are not linking in all
the
object files needed to compile fann libraries.

I'm only able to compile using linux+gcc atm, but I can help you debugging
the
windows project files if you like.

First of all: what are you using to compile fann?
We are using also the CMake buildsystem from www.cmake.org (should make
things
easier on other platforms)...
so first of all plaese try to generate the project files using cmake (on
windows it should be able to create MSVC project).

If that fails: what object files is your linker linking together? I can't
see
that info from your post :-(

I hope we can fix it together

Regards
Vincenzo

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Fann-general mailing list
Fann-general-5NWGOfrQmneRv+***@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fann-general



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Vincenzo Di Massa
2007-12-19 02:22:41 UTC
Permalink
There are a lots of new object files inside the new gsoc branch to link into
the lib.
Has anybody tried to compile on windows?
Are you using the autoconf scripts to compile the gsoc branch?
How does the makefile you use look like?

CMake can generate also CodeBlocks project files (just use latest CMake from
CVS).

CMake is a piece of cake :-)

Vincenzo
Post by Ed Cottrell
Hi Vincenzo,
Thanks for getting back to me. I recognized the errors, but can't figure
out which object files are missing.
I am compiling using mingw, called from the Code::Blocks development
environment on Windows Vista. It worked well for the 2.1 stable release,
but not for the gsoc2007 code. I'll try CMake and see if that improves
things.
Thanks,
Ed
-----Original Message-----
Di Massa
Sent: Tuesday, December 18, 2007 5:19 PM
To: FANN General and development discussion
Subject: Re: [Fann-general] Undefined symbols in fann.c: find_function()
Post by Ed Cottrell
Debug Double Win32\src\fann.o: In function
undefined reference to `fann_layer_constructor_connected_any_any'
Errors like this one means that, the project files are not linking in all the
object files needed to compile fann libraries.
I'm only able to compile using linux+gcc atm, but I can help you debugging the
windows project files if you like.
First of all: what are you using to compile fann?
We are using also the CMake buildsystem from www.cmake.org (should make things
easier on other platforms)...
so first of all plaese try to generate the project files using cmake (on
windows it should be able to create MSVC project).
If that fails: what object files is your linker linking together? I can't see
that info from your post :-(
I hope we can fix it together
Regards
Vincenzo
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
e _______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
e _______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Ed Cottrell
2007-12-19 07:38:59 UTC
Permalink
Okay, got it! I have a working FANN Double DLL.

CMake wouldn't work for me, for some reason. I ended up using mingw as
follows:

1. Added all .c and .h files in the /src folder to the project, except for
those in the gpu, optimized, and include/optimized folders.
2. Forced use of the non-dlopen code with #if 0 in fann.c (line 38).
3. Coded around asprintf and fann_safe_free with malloc + sprint + free (all
in fann.c).
4. Commented out the "else if" statements in find_function() which related
to gpu, blas, sse, or scalar code (again, in fann.c).

This appears to have gotten all of the core FANN code, along with the SOM
and GNG stuff, working properly.

Thanks for the help,
Ed


-----Original Message-----
From: fann-general-bounces-5NWGOfrQmneRv+***@public.gmane.org
[mailto:fann-general-bounces-5NWGOfrQmneRv+***@public.gmane.org] On Behalf Of Vincenzo Di
Massa
Sent: Tuesday, December 18, 2007 8:23 PM
To: FANN General and development discussion
Subject: Re: [Fann-general] Undefined symbols in fann.c: find_function()

There are a lots of new object files inside the new gsoc branch to link into

the lib.
Has anybody tried to compile on windows?
Are you using the autoconf scripts to compile the gsoc branch?
How does the makefile you use look like?

CMake can generate also CodeBlocks project files (just use latest CMake from

CVS).

CMake is a piece of cake :-)

Vincenzo
Post by Ed Cottrell
Hi Vincenzo,
Thanks for getting back to me. I recognized the errors, but can't figure
out which object files are missing.
I am compiling using mingw, called from the Code::Blocks development
environment on Windows Vista. It worked well for the 2.1 stable release,
but not for the gsoc2007 code. I'll try CMake and see if that improves
things.
Thanks,
Ed
-----Original Message-----
Di Massa
Sent: Tuesday, December 18, 2007 5:19 PM
To: FANN General and development discussion
Subject: Re: [Fann-general] Undefined symbols in fann.c: find_function()
Post by Ed Cottrell
Debug Double Win32\src\fann.o: In function
undefined reference to `fann_layer_constructor_connected_any_any'
Errors like this one means that, the project files are not linking in all the
object files needed to compile fann libraries.
I'm only able to compile using linux+gcc atm, but I can help you debugging the
windows project files if you like.
First of all: what are you using to compile fann?
We are using also the CMake buildsystem from www.cmake.org (should make things
easier on other platforms)...
so first of all plaese try to generate the project files using cmake (on
windows it should be able to create MSVC project).
If that fails: what object files is your linker linking together? I can't see
that info from your post :-(
I hope we can fix it together
Regards
Vincenzo
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
Post by Ed Cottrell
e _______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
Post by Ed Cottrell
e _______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Fann-general mailing list
Fann-general-5NWGOfrQmneRv+***@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fann-general



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Loading...