Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Sep 16th, 2005, 5:03 PM   #1
c0ldshadow
Unverified User
 
c0ldshadow's Avatar
 
Join Date: Jun 2005
Location: NJ
Posts: 23
Rep Power: 0 c0ldshadow is on a distinguished road
Red face Program compiling even without reference to required static link files

hey folks,i havent been doing that much programming over the last few months but ive gotten back into working on some stuff recently. basically the issue i'm having is that im getting a program to compile even though it shouldnt (at least i think).

i have a libgenericwipe project that contains a .cpp,.h,and .dev file in it. this libgenericwipe has not even been compiled to generate any static link libraries.

in a separate folder i have another project for the executable im making.. this project includes the .h file for libgenericwipe. in the linker section for this project, i am linking to nothing.

the program compiles without any errors or linker errors and i am able to call the genericwipe function even without linking to anything..

my guess is im missing something very obvious or im just being stupid.

here are the contents of my project files..

killer.cpp
#include <windows.h>
#include "c:\\c0ldshadow\\libgenericwipe\\genericwipe.h"
int main()
{
	genericWipe("asd");
}

genericwipe.h
#ifndef GENERICWIPE_H
#define GENERICWIPE_H
#include "genericwipe.cpp"
bool genericWipe(const char *);
#endif

genericwipe.cpp
#include <windows.h>
#include <stdio.h>
#include <string.h>
bool genericWipe(const char *what)
{
    //note i removed the code here since its not important for this issue
    return true;
}

maybe its just me but i swear that this program shouldnt compile.. i thought that the genericwipe project would need to be compiled into a static link library and then the killer.cpp would need to add this static link library file to the linker... i have done none of this, yet the code compiles and works fine...

like i said before, i havent been coding in a while so maybe im just doing something blatantly stupid or whatever..

please note that this is issue no emergency but any advice would be great..
regards,--c0ldshadow
__________________
DeepTide

The way is shut.
It was made by those who are dead
and the Dead keep it.
The way is shut.
c0ldshadow is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:58 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC