Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8232677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:54:38+00:00 2026-06-07T17:54:38+00:00

Hierarchy \Folder1 cpu.h cpu.c sources \Folder2 mem.h mem.c sources dirs cpu.h … #define nope

  • 0

Hierarchy

\Folder1
    cpu.h
    cpu.c
    sources
\Folder2
    mem.h
    mem.c
    sources
dirs

cpu.h

...
#define nope 0
...
int chuckTesta(unsigned int a);
....

cpu.c

#include <cpu.h>
int chuckTesta(unsigned int a){ ... }

mem.c

#include <cpu.h> // A
extern int chuckTesta(unsigned int a); // B

cout << nope << endl; // C
cout << chuckTesta(1); // D

Is there a way to link cpu.lib to the files within Folder2 and satisfy these requirements?

  • Remove line A
  • Line C and D still work
  • Compiles and links with no warnings (right now I’m either getting unresolved external symbol, or definition errors)

Note: Folder2’s sources file only compiles the files within Folder2, and has Folder1 as an include path. Similarly with Folder1. Each create a .lib file, cpu.lib and mem.lib respectively.

I’m using LINK, CL, and building for Windows8.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:54:40+00:00Added an answer on June 7, 2026 at 5:54 pm

    The problem with removing line A is #define nope 0. If you convert the define to a static integer (or add one) in cpu.lib it should work. Just make sure you link to both cpu.lib and mem.lib in the final executable.

    cpu.h

    ...
    #define nope 0
    static int cpu_nope = nope;
    ...
    int chuckTesta(unsigned int a);
    ....
    

    mem.c

    extern int chuckTesta(unsigned int a);
    extern int cpu_nope;
    
    cout << cpu_nope << endl;
    cout << chuckTesta(1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So here is an example folder hierarchy: c:\MyProject c:\MyProject\Folder1 c:\Myproject\Folder2 In SVN, If I
i want to know the folder hierarchy where the sms are saved and what
given a Python class hierarchy, say class Base: def method1 def method2 def method3
With the following object hierarchy, I need to confirm whether or not all string
I am making an hierarchy of sorts and am having trouble adding an element
I have an interface hierarchy similar to - interface Type { Type copy(); };
I have a hierarchy of templated classes that are constructed in one place and
i deserialize a widget-hierarchy using gson, but have problems deserializing final fields. Example: public
Lets say I have hierarchy like this (This is just a test program. Please
Consider this class hierarchy: Book extends Goods Book implements Taxable As we know, there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.