Multiple compilation errors LNK2019

I have multiple errors relating to my source code


https://www.dropbox.com/s/qii6ti08xydelve/Coursework1.cpp

the erros im getting are:


1> All outputs are up-to-date.
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl admin(void)" (?admin@@YAXXZ) referenced in function "void __cdecl process_main_menu(char)" (?process_main_menu@@YAXD@Z)
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl calc_new_member(void)" (?calc_new_member@@YAXXZ) referenced in function "void __cdecl process_main_menu(char)" (?process_main_menu@@YAXD@Z)
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl assign_loads(void)" (?assign_loads@@YAXXZ) referenced in function "void __cdecl process_selection_limit_state(char)" (?process_selection_limit_state@@YAXD@Z)
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl determine_loads_file(void)" (?determine_loads_file@@YAXXZ) referenced in function "void __cdecl process_selection_limit_state(char)" (?process_selection_limit_state@@YAXD@Z)
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl member_dimensions_file(void)" (?member_dimensions_file@@YAXXZ) referenced in function "void __cdecl process_selection_limit_state(char)" (?process_selection_limit_state@@YAXD@Z)
1>Coursework_1.obj : error LNK2019: unresolved external symbol "void __cdecl select_member_manually(void)" (?select_member_manually@@YAXXZ) referenced in function "void __cdecl display_details_member(void)" (?display_details_member@@YAXXZ)


the header file has code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <string>


//record for loads on beam
struct load_values
{
	int		service_class,																				//to store value of service calss type
			gk_load,																					//to store value of either 1 or 0 - could use bool
			qk_load,																					//to store vaule of either 1 or 0 -could use bool
			load_no;

	float	unfactored_load,																			//to store value of unfactored load
			factored_load,																				//decalre float variables for loads
			duration_class;																				//to store details of duration class
}cases[50];
//record for member details
struct member_details
{
	float	member_length,																				//to store member length
			member_width,																				//to store member width
			member_depth,																				//to store member depth
			member_qk_factored_load,																	//to store unfactored load
			member_gk_factored_load,																	//to store factored load
			member_max_moment,																			//to store moment
			member_shear;																				//to store shear value
	int		member_type,																				//to store member type for quicker search
			member_no;																					//to display record number
	std::string	member_name;																				//to store member name e.g. beam or column
}record[100];
//record for timber properties
struct timber_strength_properties
{
	std::string timber_grade;																				//declare string variable
	int values[13][18];																						//declare integers to store value associated with grade
};
//record for sawn timber dimensions
struct timber_properties_sawn
{
	int width,depth,area,Wyy,Wzz,Iyy,Izz,iy,iz;															//decalre integers to store values for timber sawn
}table1[9][50];
//record for planed timber dimensions
struct timber_properties_planed
{
	int width,depth,area,Wyy,Wzz,Iyy,Izz,iy,iz;															//decalre integers to store values for timber planed
}table2[9][50];
These errors are very straightforward.

They are telling you that the definitions for those functions listed were not found. This could be because you weren't consistent in your naming schemes (everything is case-sensitive), you made a typo, or you forgot to actually include the definition.

You declared and defined the function "Admin()" but you tried to use "admin()".

"calc_new_member()", "assign_loads()", "determine_loads_file()", "member_dimensions_file()", and "select_member_manually()" aren't even defined.
Last edited on
Thank you very much.... would you able to help with one more question??

When I run the programme and Select Option B then A it does not call the function member_dimensions()... or if it does it goes straight back to the calling function.

thanks
Can you put the code back up? The dropbox link isn't working anymore.

But, I do recall seeing some completely empty function definitions - could "member_dimensions()" have been one of them?
Lines 169, 171, and 174 shouldn't compile. On line 168, you declare char menu_selection; but then use menuSelection on the other lines.

It feels like there is a lot of copy/pasting going on. This is never a good practice - it usually signifies that something can be done in a much easier way. It also makes your code prone to mistakes such as the above.

The loops on lines 278 and 531 are never executed. You should reevaluate the logic.

The loop on 545 is flawed - you cannot do comparisons like that. You must write it out entirely: while(temp_duration_class != 1 && temp_duration_class != 2 && ...). Or you could use ranges: while(temp_duration_class < 0 || temp_duration_class > 5)

The loops on lines 239 and 253 will never run. Check your logic.

As for your specific problem in your last post, it looks like runtime will get caught in the loop on line 171 unless the user inputs 'H'. It also seems that line 173 isn't what you want there, but I'm not sure.

I highly recommend that you use a debugger to step through the code to fully understand what is going on.

EDIT: oops, all of my line #s seem to be wrong after I refreshed the page. Maybe you edited it? I'll try to fix them. Fixed.
Last edited on
Topic archived. No new replies allowed.