2009/5/16 Hendrik Sattler <[email protected]>
> Am Freitag 15 Mai 2009 17:05:58 schrieb ankit jain:
> [...]
>
> The following works with VS2008 without any problem as expected:
> CMakeLists.txt:
> --------------------------------------------------------------
> project(var C)
> add_executable(var sub/main.c var.c var.h)
> --------------------------------------------------------------
>
Just try this:
add_library(var sub/main.c var.c)
>
> var.c:
> --------------------------------------------------------------
> // #include "var.h"(dont include this line since no var.h is there)
>
#include<stdio.h>
> char* var1 = "Hallo";
> --------------------------------------------------------------
>
> //var.h:
> --------------------------------------------------------------
> //extern char *var1;
> --------------------------------------------------------------
>
> sub/main.c
> --------------------------------------------------------------
> // #include "../var.h"
> #include <stdio.h>
extern char *var1;
>
> int main (int argc, char **argv)
> {
> printf(var1);
> return 0;
> }
> --------------------------------------------------------------
>
> So the problem is _definitely_ with your code.
>
I made the changes above can u run this code for me and let me know whether
it is working or not.
i commented the line which are not there in my code. Also here var.h is not
exits since code of var.h is directly there in main.c..
Ankit
>
> HS
>
>
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake