简体   繁体   中英

CLion link an existing .o file to project

My professor has given us a "mystery" function - p4test.o that needs to be called from our main().

How do I add this to my CLion project to be able to call it?

If you don't have header files for the object files you need to reverse their exports and create the header file yourself. From that point on you can use them from your code and link the object files in later on.

Here is an answer that can tell you how to do this: How do i find out what all symbols are exported from a shared object?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM