Page 1 of 1

Problems in Mac OS X 10.5.8

Posted: Sun Dec 25, 2011 2:32 am
by cheburan
Dear colleagues,

Could you help me with my problem in CodeLite under Mac OS X? I tried made new template project "Hello world" and can't compile it. Firstly I created empty workspace and secondary created console project:

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
	printf("hello world\n");
	return 0;
}
Build command illustrate follow results:

Code: Select all

gcc -c  "/Users/Anton/Data/Projects/temp_prj/testworspace/Test1/main.c" -g  -o ./Debug/main.o -I. -I. 
gcc -o ./Debug/Test1 @"/Users/Anton/Data/Projects/temp_prj/testworspace/Test1/Test1.txt" -L.   
i686-apple-darwin9-gcc-4.0.1: @/Users/Anton/Data/Projects/temp_prj/testworspace/Test1/Test1.txt: No such file or directory
i686-apple-darwin9-gcc-4.0.1: no input files
make: *** [Debug/Test1] Error 1
File Test1.txt contains just one row: "./Debug/main.o"
I tried check in command:

Code: Select all

gcc -o ./Debug/Test1 ./Debug/main.o -L. 
inplace of

Code: Select all

gcc -o ./Debug/Test1 @"/Users/Anton/Data/Projects/temp_prj/testworspace/Test1/Test1.txt" -L.
and it is work well....

Could you tell me why I can't build project by using build command of codelite and what is difference between two rows:

Code: Select all

gcc -o ./Debug/Test1 ./Debug/main.o -L. 

and 

gcc -o ./Debug/Test1 @"/Users/Anton/Data/Projects/temp_prj/testworspace/Test1/Test1.txt" -L.
Conceptually it is should be same as I understood, becuase Test1.txt file contains list of object files for building. Thanks a lot for your answers!

Re: Problems in Mac OS X 10.5.8

Posted: Sun Dec 25, 2011 3:18 pm
by frank_frl
Goto Build Settings/Compilers/g++/Advanced and uncheck 'Pass object list to linker via file'

Frank

Re: Problems in Mac OS X 10.5.8

Posted: Mon Dec 26, 2011 1:18 am
by eranif
cheburan wrote:Could you tell me why I can't build project by using build command of codelite and what is difference between two rows:
It should work, I think it is a bug in Mac's GCC

But do as Frank wrote and it will work for you.
The reason I added the option to pass the objects in a file instead in a command line directly is that on some OSs there is a limitation on the command line arguments that can be passed - so this workaround is needed (for example: when compiling codelite on Windows)

Eran

Re: Problems in Mac OS X 10.5.8

Posted: Sat Jan 07, 2012 3:41 am
by cheburan
Thanks a lot for all answers. I tried to like Frank describes. Seems that it work. Probably GCC under MacOS doesn't understand object list inside txt file.

I think this topic can be closed.

Best regards!