Cmake unable to link source file

Completed

I have a 3 classes which is customer, doublelinkedlist and queue.

When I build the project, it shows that my main is unable to link to this source file.

What is the problem?


0
6 comments

Hi Yhuang006. When you add executable first argument it's target name.  Please see https://cmake.org/cmake/help/latest/command/add_executable.html

 

0
Avatar
Permanently deleted user

 Although I change my add executable as follow

add_executable(project1 main.cpp Queue.h Queue.cpp Customer.h Customer.cpp DLL.h DLL.cpp)

it still gives me the same error



0
Avatar
Permanently deleted user

If I delete my decleration of my template double linkedlist and addFirst function in my main() function, it can compile.

what is the possible problem?

0

I can't say for sure without the project. 

Why do you think that it's a CLion problem?

0
Avatar
Permanently deleted user

The problem happens in the linkage state so cmake cannot link my source files. That’s what I think.

0
Avatar
Permanently deleted user

Fixed.

Thanks for your response Maxim.

appreciate it.

0

Please sign in to leave a comment.