Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error LNK2001: unresolved external symbol <===----HELP!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, I got the below when compiling. Using nrutil.h for some matrix functions, can help?

Linking...
SSD.obj : error LNK2001: unresolved external symbol "void __cdecl free_matrix(float * *,long,long,long,long)" (?free_matrix@@YAXPAPAMJJJJ@Z)
SSD.obj : error LNK2001: unresolved external symbol "float * * __cdecl matrix(long,long,long,long)" (?matrix@@YAPAPAMJJJJ@Z)
Debug/SSD.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Also, tried using


#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

But still got

Linking...
SSD.obj : error LNK2001: unresolved external symbol _free_matrix
SSD.obj : error LNK2001: unresolved external symbol _matrix
Debug/SSD.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

How??? Please help!!! Been trying whole day to rectify :((((((((((((...............
 
I think the problem is you wrote your two functions in a separate file and you didn't add the *.cpp and *.h files in your project.
Go in File View, insert the *.cpp in Source Files folder and the *.h in Header Files folder.

Gilles
 
Is nrutil.h the header to a library(*.lib) file. If so you need to add the library to you Library Modules in your project settings\Link tab (assuming VC++).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top