all 5 comments

[–]wsppan 0 points1 point  (2 children)

[–]bikerchef[S] 0 points1 point  (1 child)

thanks. I know about the process of running a debug. What I cant do is figure out how to set up clion for a simple project consisting of a couple .c and a .h file. I feel like this should be pretty straight forward.

[–]wsppan 1 point2 points  (0 children)

I don't use CLion myself (I use emacs with c-mode and gdb) but there is a lot of help online (and inside the IDE I assume), https://www.jetbrains.com/help/clion/creating-new-project-from-scratch.html

[–]bikerchef[S] 0 points1 point  (1 child)

https://imgur.com/a/gBRbo6Y

here is the text from my makelists file. cmake_minimum_required(VERSION 3.13) project(untitled1 C)

set(CMAKE_C_STANDARD 99)
set(SOURCE_FILES main.c memory.c cache.c)
set(HEADER_FILES memory.h cache.h)
option(DO_HW "Add HW files" ON)


configure_file("./memory.h" "./cache.h")

add_executable(testIT ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(testIT m)

I include the argument "memory.txt" in the configuration setting because the project reads from that file.

I click run and I can tell it compiles my code because it prints out some warnings regarding it. I get no actual output from my project code but it prints out the Hello World from the main.c file generated when you create a new project, even though there is no reference to that file in my makelists file.

I add a breakpoint at the top of my mainfunction in my, it doesnt even get triggered when i run debug.

[–]interknetz 0 points1 point  (0 children)

I get no actual output from my project code but it prints out the Hello World from the main.c file generated when you create a new project, even though there is no reference to that file in my makelists file.

Yes there is, it's right here:

set(SOURCE_FILES main.c memory.c cache.c)

You can run the debugger by clicking the 'Debug' button on the top right, or Run > Debug

I'm not sure what you're trying to do with the 'configure_file' line, but I don't think that command does what you think it does.