Newbie struggling with makefile and linker
-
Hello, I have a problem with makefile and linker. I get error LNK2001: unresolved external symbol "int __cdecl LibFunction(char *,int)" (?LibFunction@@YAHPADH@Z), when trying to use Function that is in mylib.lib. I have macros: LINK_FLAGS=/machine:I386 LIBS=..\lib\mylib.lib and I'm trying to link like this: myprogram.exe: $(OBJS) link $(LIBS) $(LINK_FLAGS) $(OBJS) /OUT:$@ How do I make the linker realize that LibFunction is in mylib.lib? Regards, -Janetta
-
Hello, I have a problem with makefile and linker. I get error LNK2001: unresolved external symbol "int __cdecl LibFunction(char *,int)" (?LibFunction@@YAHPADH@Z), when trying to use Function that is in mylib.lib. I have macros: LINK_FLAGS=/machine:I386 LIBS=..\lib\mylib.lib and I'm trying to link like this: myprogram.exe: $(OBJS) link $(LIBS) $(LINK_FLAGS) $(OBJS) /OUT:$@ How do I make the linker realize that LibFunction is in mylib.lib? Regards, -Janetta
-
Try to put your lib name and path into the Project/Settings/Link - Object/Library Modules editbox for all configurations that need it. ~RaGE();
There is only 'General' and 'Debug' tabs in the 'Settings' of this project. I guess it's because it is a makefile-project. If I'm wrong, please correct me. But aren't those tabs only a another way to tell the compiler and linker how to make the .exe. So what do I have to do my makefile instead of changing settings? PS. I would do the program withaut makefile if I could, but there is so much more in it. Btw, is there a way to combine a "normal" project and makefile? -Janetta
-
There is only 'General' and 'Debug' tabs in the 'Settings' of this project. I guess it's because it is a makefile-project. If I'm wrong, please correct me. But aren't those tabs only a another way to tell the compiler and linker how to make the .exe. So what do I have to do my makefile instead of changing settings? PS. I would do the program withaut makefile if I could, but there is so much more in it. Btw, is there a way to combine a "normal" project and makefile? -Janetta
Create a project with the settings you want to use. Then select Export Makefile from the Project menu. Merge/plagerize the result with your makefile project.